I am having a performance issue with this code.
Application.Calculation = xlCalculationManual
mypath = "'L:\xx\"
p = "[xxx.xls]"
x = mypath & p
lcolumn = Range("B3").End(xlToRight).Column
For Each rCell In Range(Cells(4, 3), Cells(4, lcolumn))
y = Cells(rCell.Row, 2).Address(0, 1)
z = Cells(1, 2).Value & Cells(2, rCell.Column).Value
q = Cells(1, rCell.Column).Address(1, 0)
rCell.Formula = "=IF(" & y & "=" & Chr(34) & "Placeholder" & Chr(34) & ",0,vlookup(" & y & "," & x & z & "'!$C$12:$P$2000," & q & ",FALSE))"
Next rCell
The above code takes forever to put the formula into each cell. However, if I change the code for rcell to "rcell.value=1", it flies through it. Is there a way to make the formula more efficient?
Thanks!
Bookmarks