I have the following piece of code that I use in a loop that runs over 32 rows to insert the following
j = 1
For i = 10 To 23 Step 1
Cells(i, j + 1).Select
' Range("b10").Select
Call sn
Cells(i, j + 2).Select
' Range("c10").Select
Call RT_on
Cells(i, j + 3).Select
' Range("d10").Select
Call RT_off
Cells(i, j + 9).Select
' Range("j10").Select
Call ord_time
Cells(i, j + 10).Select
' Range("k10").Select
Call OT
Cells(i, j + 11).Select
' Range("l10").Select
Call Passive
Cells(i, j + 15).Select
' Range("p10").Select
Call comm
Next i
sub comm()
ActiveCell.FormulaR1C1 = "=IF(RC[-15]="""","""",IF(
VLOOKUP(R1
0C18,BLP_D
ates,2,FAL
SE)=0,""""
,VLOOKUP(R
10C18,BLP_
Dates,2,FA
LSE)))"
tmpValue = ActiveCell.Value
ActiveCell.FormulaR1C1 = ""
ActiveCell.Value = tmpValue
end sub
I have the problem that I cannot get the reference for the vlookup to also do the same, any help would be greatly appreciated. As I do not want to go back to write this for each line
Start Free Trial