Hi
I think Alan hasn't defined the variable 'lr'. This line needs to be inserted:
lr = s1.Range("A" & Rows.Count).End(xlUp).Row
Sub MoveData()
Dim lr As Long, i As Long
Dim s1 As Worksheet, s2 As Worksheet
Set s1 = Sheets("Sheet1")
Set s2 = Sheets("Sheet2")
Dim lr2 As Long
Application.ScreenUpdating = False
lr = s1.Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To lr
lr2 = s2.Range("A" & Rows.Count).End(xlUp).Row
If s1.Range("E" & i) = "!!!" Then
s1.Range("E" & i).EntireRow.Copy s2.Range("A" & lr2 + 1)
End If
Next i
Application.CutCopyMode = False
Application.ScreenUpdating = True
MsgBox "complete"
End Sub
DBY
Bookmarks