+ Reply to Thread
Results 1 to 6 of 6

Vba Syntax to Excel Spreadsheet Error

  1. #1
    Registered User
    Join Date
    03-25-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    34

    Vba Syntax to Excel Spreadsheet Error

    I have the following code which does insert formulas in the right location yet when inserting it changes the formula syntax. The actual error is #NAME? ,The code is as follows:

    Please Login or Register  to view this content.
    When in the spreadsheet, the syntax is changed to:

    =IF(ISNA(VLOOKUP('A2',Sheet1!AE),5,FALSE))=TRUE,$B:$B,VLOOKUP('A2',Sheet1!AE),5,FALSE))

    Notice the quote/Tick marks around the A2 and Parenthesis around E. I tried Modifying the code but my changes wouldn't work. I feel like this is something simple im overlooking.

    Any help is appreciated.
    Last edited by penbeacho; 07-29-2015 at 02:36 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,065

    Re: Vba

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Never use Merged Cells in Excel

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,065

    Re: Vba

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

  4. #4
    Registered User
    Join Date
    03-25-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    34

    Re: Vba Syntax to Excel Spreadsheet Error

    Sorry ist been corrected

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

    Re: Vba Syntax to Excel Spreadsheet Error

    You should use '.Formula = ', not '.FormulaR1C1 = '

  6. #6
    Registered User
    Join Date
    03-25-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    34

    Re: Vba Syntax to Excel Spreadsheet Error

    WOW!!!! Cant believe I overlooked that. I guess I was more focused on the formula syntax than the actual command itself.

    Thankyou !!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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