PDA

View Full Version : Macro vlookup with fill down



preseb
07-06-2011, 05:50 AM
I am using ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-7],YTD_By_Trans_Code!C[-7]:C[-4],4,0)"
for my vlookup, but I am having trouble getting it to fill down.

suggestions?

preseb
07-06-2011, 07:47 AM
I changed the code to:

Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
With Range("H" & LR)
.Formula = "=VLOOKUP(RC[-7],YTD_By_Trans_Code!C[-7]:C[-4],4,0)"
.Value = .Value
End With

But now it does nothing.
I was trying to get it to look at column A to see how long the data is, then apply the vlookup formula to column H

preseb
07-06-2011, 07:50 AM
Got it: I need to change "H" & LR to "H2:H" & LR

- hey how to I mark a tread as SOLVED

Paul_Hossler
07-06-2011, 08:29 AM
Glad we could help :rotlaugh:

Thread Tools at the top, and click Solved

Paul