mumps
Well-known Member
- Joined
- Apr 11, 2012
- Messages
- 14,076
- Office Version
- 365
- 2010
- Platform
- Windows
I have three named ranges as seen in the macro below. The macro generates the error: Run-time error '1004': Method' Range' of object' _Worksheet' failed with the line in yellow highlighted on Debug. Would anyone have any suggestions as to the cause of the error?
Rich (BB code):
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
Application.EnableEvents = False
Dim fnd As Range, rng As Range
Set rng = Union(Range("MondayE"), Range("MondayG"), Range("MondayI"))
If Not Intersect(Target, rng) Is Nothing Then
Set fnd = Sheets("Lists").Range("A:A").Find(Target.Value, LookIn:=xlValues, lookat:=xlWhole)
If Not fnd Is Nothing Then
fnd.Resize(2).Copy Range(Target.Address)
End If
End If
Application.EnableEvents = True
Application.ScreenUpdating = False
End Sub