+ Reply to Thread
Results 1 to 9 of 9

VBA End of Statement Error

  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
    Please Login or Register  to view this content.

    Here is the desired macro:

    Please Login or Register  to view this content.
    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.

  2. #2
    Registered User
    Join Date
    04-02-2012
    Location
    Kansas
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: VBA End of Statement Error

    Is it possible for you to upload a document that you are using the vba in so that I can take a look?

    Thanks,
    Crystal

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

    Re: VBA End of Statement Error

    The file is massive and mostly confidential but I will create an unloadable sample. Give me just a minute.

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

    Re: VBA End of Statement Error

    Here it is, the macro with the dumby text is "Testerrr" and the full formula is in J4.

    Thanks so much. Help Request.xlsm

  5. #5
    Valued Forum Contributor
    Join Date
    09-17-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    454

    Re: VBA End of Statement Error

    I haven't looked at your file yet, but I'm working on the assumption that you just need to duplicate all quotation marks in the formula as required by the vb editor.

    Please Login or Register  to view this content.

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

    Re: VBA End of Statement Error

    This helped but now I am getting a different error: "Application-defined or object-defined error". and the debugger is highlighting the following:

    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    09-17-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    454

    Re: VBA End of Statement Error

    You need to use Formula not FormulaR1C1

    formula_entry.xlsm (makes #N/A s because there is no data)

    Please Login or Register  to view this content.

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

    Re: VBA End of Statement Error

    Thank you so much. One final thing.

    I tried repeating the same code on another formula in the same macro and am running into the same problem:

    Please Login or Register  to view this content.

  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: VBA End of Statement Error

    Too many closing parenthesis.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

+ Reply to Thread

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. [SOLVED] 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. 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. [SOLVED] 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