VBA Formula Question

B

Barb Reinhardt

I have the following

ActiveCell.FormulaR1C1 = _

"=VLOOKUP(RC7,WorksheetPivot!R3:R7,MATCH(R1C,WorksheetPivot!R2),FALSE)"

I want to change R7 to be variable based on the number of rows in the
worksheet. I have a value for that which I'll call "lrow". What do I need
to do to change the R3:R7 to R3:R &lrow?

Thanks,
Barb Reinhardt
 
N

Niek Otten

Hi Barb,

"=VLOOKUP(RC7,WorksheetPivot!R3:R" & lrow &
",MATCH(R1C,WorksheetPivot!R2),FALSE)"
 

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