View Single Post
 
Old 09-23-2016, 10:04 AM
mbesspiata mbesspiata is offline Windows 7 64bit Office 2010 64bit
Advanced Beginner
 
Join Date: Mar 2011
Location: Virginia
Posts: 57
mbesspiata is on a distinguished road
Default Vlookup fill down blank cells in column

I want to use vlookup in a column and then autofill that column after entering the formula in the first cell of the column. I need the autofill to ONLY fill in the blank cells in the column as there is data in the bottom of the column already.
I want to use this in a current macro I am using. Currently I have the macro only create the vlookup formula and enter the data in the first cell. I then manually drag the formula down to the last blank cell in the column. I want to use a vba to have it fill in the rest of the blank cells.
Here is the beginning part of the marco where I insert the vlookup formula. Column E has blank cells in an undetermined amount of cells with each report I produce. I only want to fill in the date for those blank cells and don't want the vlookup formula to be applied to cells with data in them for the rest of column E.
Range("E2").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-1],'[CBP Port and Other Agency Listing.xlsx]Combined'!C4:C5,2,FALSE)"

This is what the worksheet looks like and column E is has blank cells down for a different number each week I run the report. (see attached screenshot)

How can this be done or can it be done?

Mike
Attached Images
File Type: jpg Capture.JPG (35.7 KB, 19 views)
Reply With Quote