vlookup Variables

M

Megadrone

I download a new spreadsheet everyday, this spreadsheet will have several new
rows everytime.

What I need is for this lookup to automatically find the last row in the
table array

Range("H2").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[8],'[Cell Refs Update Macro
V3.xls]Lookup'!R2C1:R1770C5,3,FALSE)"
Selection.AutoFill Destination:=Range("H2:H" & lastrow)

Can anybody help me?
 
K

Ken Hudson

Hi,
One way:

LastRow=Range("A65536").End(xlUp).Row

(Assuming that column A has data in the last row.)
 
D

Dave Peterson

Remember to check your other post(s).
I download a new spreadsheet everyday, this spreadsheet will have several new
rows everytime.

What I need is for this lookup to automatically find the last row in the
table array

Range("H2").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[8],'[Cell Refs Update Macro
V3.xls]Lookup'!R2C1:R1770C5,3,FALSE)"
Selection.AutoFill Destination:=Range("H2:H" & lastrow)

Can anybody help me?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top