Consulting

Results 1 to 4 of 4

Thread: how to use VLOOKUP only for blank cells in column A

  1. #1
    VBAX Newbie
    Joined
    Mar 2011
    Posts
    5
    Location

    how to use VLOOKUP only for blank cells in column A

    Hi all, I am having trouble finishing the macro and was wondering if someone could help me out with below. Here is the summary:

    1) I need to use VLOOKUP in Column A (starting Cell A3 and all the way down, this is where I would utalize LastRow=Cell.Find("*".[A1],,, xlByRows, xlPrevious).Row
    2) In total I have 4,000 rows (changes daily though)
    3) there are about 1,000 random blank cells in column A
    4) I need VLOOKUP to loop/scan the whole column and populate the vlookup formula only for blank cells


    Any help would be much appreciated. I was thinking of using autofilter, finding blank cells, but I was hoping there is an easier way

    Thanks so much

  2. #2
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    hi.
    try:

    [vba]Range("A3:A" & LastRow).SpecialCells(xlCellTypeBlanks).Formula = WorksheetFunction.VlookUp(blah blah)[/vba]
    for limit of specialcells : http://www.rondebruin.nl/specialcells.htm
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

  3. #3
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    i'm not sure if it is a typo....

    for last row try:

    [VBA] LastRow = Cells.Find("*", searchorder:=xlByRows, searchdirection:=xlPrevious).Row[/VBA]
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

  4. #4
    VBAX Newbie
    Joined
    Mar 2011
    Posts
    5
    Location
    awesome.. works great. thanks a lot

Posting Permissions

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