Results 1 to 9 of 9

VBA End of Statement Error

Threaded View

  1. #1
    Registered User
    Join Date
    05-29-2015
    Location
    Providence
    MS-Off Ver
    2013
    Posts
    32

    VBA End of Statement Error

    VBA help



    I am writing a Macro that adds rather large formulas to cells, I decided to save myself some time by first recording the outline of the macro with dumby forumlas () and then adding the real formulas into the code editor.

    Here is the desired formula:

    Formula: copy to clipboard
    =VLOOKUP($B16,'HotelAVE Chart of Accounts'!$B$2:$C$30,2,FALSE)&"-"&VLOOKUP($C16,'HotelAVE Chart of Accounts'!$B$34:$C$66,2,FALSE)&"-"&VLOOKUP($D16,'HotelAVE Chart of Accounts'!$B$70:$C$73,2,FALSE)&"-"&VLOOKUP('Input Sheet'!$E16,'HotelAVE Chart of Accounts'!$B$78:$C$90,2,FALSE)&"-"&VLOOKUP('Input Sheet'!$F16,'HotelAVE Chart of Accounts'!$B$94:$C$407,2,FALSE)&"-"&VLOOKUP(IF($G16="","None",$G16),'HotelAVE Chart of Accounts'!$B$411:$C$704,2,FALSE)

    Here is the desired macro:

    Range("H16").Select
     ActiveCell.FormulaR1C1 = "=IF(Banana=Bana,"""",Poop)"
    Where dumby formula is "=IF(Banana=Bana,"""",Poop)".

    Now, when I replace the dumby formula with the real formula above I get a compiler error that say 'end of statement' and the debugger highlights the "None" in the formula. Whats the deal and how can I fix it?
    Last edited by djl295; 07-23-2015 at 02:49 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Getting #value! Error with =min(if statement
    By Abyrose in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-18-2014, 03:13 PM
  2. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  3. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  4. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  5. Runtime Error - Subscript out of range despite On Error statement
    By DoctorG in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-28-2006, 11:05 AM
  6. [SOLVED] Path/File access error (Error 75) using Name Statement
    By blayne in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-22-2005, 05:25 PM
  7. Path/File access error (Error 75) after using Name Statement
    By blayne in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-09-2005, 08:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1