malleshg24
10-09-2019, 07:56 PM
Hi Team,
Please help how to pass variable NameCol = 2. in R1C1 Formula,
=VLOOKUP(RC[-5] here I want (-5) it Dynamic.
Dim nameCol As Long
nameCol = Application.WorksheetFunction.Match("Name", Range("1:1"), 0)
nameCol = 2
Range("g2").FormulaR1C1 = "=VLOOKUP(RC[-5],R1C13:R15C18,3,0)"
Range("g2").FormulaR1C1 = "=VLOOKUP(RC[-5],R1C11:R9C15,2,0)"
'=VLOOKUP(B2,$K$1:$O$9,2,0)
Thanks in Advance for your help.
Regards,
mg
Please help how to pass variable NameCol = 2. in R1C1 Formula,
=VLOOKUP(RC[-5] here I want (-5) it Dynamic.
Dim nameCol As Long
nameCol = Application.WorksheetFunction.Match("Name", Range("1:1"), 0)
nameCol = 2
Range("g2").FormulaR1C1 = "=VLOOKUP(RC[-5],R1C13:R15C18,3,0)"
Range("g2").FormulaR1C1 = "=VLOOKUP(RC[-5],R1C11:R9C15,2,0)"
'=VLOOKUP(B2,$K$1:$O$9,2,0)
Thanks in Advance for your help.
Regards,
mg