Hello,
I am having some trouble with code I am trying to write. I need the variable LR to be redefined on each worksheet the code works on. I keep getting an error on the line underlined below. Hoping someone can help.
I am having some trouble with code I am trying to write. I need the variable LR to be redefined on each worksheet the code works on. I keep getting an error on the line underlined below. Hoping someone can help.
Code:
Sub Update_Actuals()
Dim LR As Variant, i As Long, NUM As Long, ws As Variant
NUM = Sheet2.Range("E46").Value
Application.ScreenUpdating = False
For Each ws In Array("MT IMP", "MT RES IMP", "MT R")
With Sheets(ws)
[U] Set LR = ws.Range("T" & ws.Rows.Count).End(xlUp).Row[/U]
For i = 18 To LR
.Range("H" & i).Copy
.Range("H" & i).Resize(, NUM).PasteSpecial _
Paste:=xlPasteFormulas
i = i + 16
Next i
End With
Next
Application.CutCopyMode = False
Application.ScreenUpdating = True
MsgBox ("Done")
End Sub