Results 1 to 6 of 6

Vba Syntax to Excel Spreadsheet Error

Threaded View

  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:

    Sub InsertFormulas()
    'Transition Data Corretion
    Dim lLR As Long
    lLR = Range("A2").End(xlDown).Row  'Starts at A2 "Reference Column" and goes to Empty Cell-1
    'Enter Formulas into CarAllow Sheet
    Range("B2:B" & lLR).FormulaR1C1 = "=IF(ISNA(VLOOKUP(A2,Sheet1!A:E,2,FALSE))=TRUE,A2,VLOOKUP(A2,Sheet1!A:E,2,FALSE))"
    Range("D2:D" & lLR).FormulaR1C1 = "=IF(ISNA(VLOOKUP(A2,Sheet1!A:E,5,FALSE))=TRUE,C2,VLOOKUP(A2,Sheet1!A:E,5,FALSE))"
    ''''
    End Sub
    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.

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