I have a table in sheet1 of a workbook like this:
section | Class
11 | 2
11 | 2
12 | 3
12 | 3
12 | 3
13 | 4
On sheet 2 I have something like this:
section | Class
11 |
11 |
11 |
11 |
11 |
11 |
12 |
12 |
12 |
12 |
12 |
13 |
I want to use the lookup function in sheet2 to get the value for Class from sheet1 and this is the macro that is generated for the first cell only:
ActiveCell.FormulaR1C1 = _
"=LOOKUP(RC[-1],Sheet1!RC[-1]:R[4]C[-1],Sheet1!RC:R[4]C)"
My actual formula is:
=LOOKUP(A2,Sheet1!A2:A6,Sheet1!B2:B6)
I would want it to be like:
=LOOKUP(A2,Sheet1!$A$2:A6,Sheet1!$B$2:B6)
but this not allowed. Could anybody help me fill in the Class column?