How to convert a formula to VB
Posted on 2015-02-06
I am trying to convert the following double lookup formula to VB with no success.
The formula works if I put it in the cells in column G but I can't get VB to do so.
The wildcard ? is a variable row number. ProdData is a named range in the worksheet ProcessTimes. Here is the code I was trying to use but have tried many different variations with no success:
For Cntr2 = 2 To lastRow
Range("G" & Cntr2).Formula = "=IF(A"&Cntr2&"="""","""",VLOOKUP(A"&Cntr2&",ProcessTimes,MATCH(E"&Cntr2"&,ProcessTimes!B1:FQ1,0),TRUE))"