R
Relative Ref in VLookup for search value
I am creating a visual basic macro to work with time data. In the data the
staff names are in the first column. I want a macro that can be started at
multiple locations in the worksheet. I want to pull data from a VLookup
table the macro has inserted on another part of the worksheet.
My macro is using relative reference with a multiply formula and works fine.
When I try to use a specific cell, say A3 as the search value for the
VLookup arguments, it works fine, but only grabs the absolute cell A3. So I
tried to use RC relative reference for the search value and It says compile
error. I tried every imaginable way to fill in the search value cell and I
can't get it to work.
A Line of macro follows:
ActiveCell.Offset(0, 16).Formula = "=VLOOKUP(RC[-16],V$3:W$20,2,FALSE)"
What form of reference might work?
staff names are in the first column. I want a macro that can be started at
multiple locations in the worksheet. I want to pull data from a VLookup
table the macro has inserted on another part of the worksheet.
My macro is using relative reference with a multiply formula and works fine.
When I try to use a specific cell, say A3 as the search value for the
VLookup arguments, it works fine, but only grabs the absolute cell A3. So I
tried to use RC relative reference for the search value and It says compile
error. I tried every imaginable way to fill in the search value cell and I
can't get it to work.
A Line of macro follows:
ActiveCell.Offset(0, 16).Formula = "=VLOOKUP(RC[-16],V$3:W$20,2,FALSE)"
What form of reference might work?