Dim LastRowC As Long
Dim LastRowE As Long
Dim Deelnemernr As Long
LastRowC = Range("C1048576").End(xlUp).Row + 1
Deelnemernr = Cells(LastRowC, 3).Offset(0, 4).Select
I can manage to select the variable cell which I want to use in my formula below. So the code above works.
LastRowE = Range("E1048576").End(xlUp).Row + 1
Cells(LastRowE, 5).Formula = "=Index(E:E,Match(Deelnemernr,G:G,0))"
What I cannot seem to do is use the variable declared above as Deelnemernr in my Match formula. When I use a fixed cell (for example G12) in stead of Deelnemernr the formula does work. Can anyone tell my how the refer to a declared variable in a formula?