Results 1 to 4 of 4

Vlookup and autofill a dynamic range

Threaded View

  1. #1
    Registered User
    Join Date
    12-07-2009
    Location
    Fiji
    MS-Off Ver
    Excel 2007
    Posts
    16

    Vlookup and autofill a dynamic range

    I am trying to Vlookup and autofill a dynamic range.
    My codes are as below

    Sub test()
    
    Sheets("Data").Select
    Dim LastRow As Long
    LastRow = Cells.Find(What:="*", _
    SearchDirection:=xlPrevious, _
    SearchOrder:=xlByRows).Row
    Range("B2:B" & LastRow).FormulaR1C1 = "= VLOOKUP(A2,Reference!A:B,2,0)"
    Application.CutCopyMode = False
    End Sub
    the Macro runs but it returns

    PBU ID
    10014 #NAME?

    Range("B2:B" & LastRow).FormulaR1C1 = "= VLOOKUP(A2,Reference!A:B,2,0)"
    Need help here so the macro auto fills coloum B

    Help Please
    Sample attached
    Attached Files Attached Files
    Last edited by ajay1967; 01-19-2012 at 08:04 PM. Reason: Forgot the rules for codes

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