Error 1004: Copy method of Range class failed

Hazman_08

New Member
Joined
Aug 30, 2023
Messages
12
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Have put the following code into sheets. Worked the first time, now getting Copy method error.

Sheet6:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.CountLarge = 1 And Not Intersect(Range("D19:I22"), Target) Is Nothing Then
On Error GoTo Escape
Application.EnableEvents = False
Target.Copy Sheet7.Range(Target.Address).Offset(-14, 1) '<-- *** Sheet code name used ***
End If
Continue:
Application.EnableEvents = True
Exit Sub
Escape:
MsgBox "Error " & Err.Number & ": " & Err.Description
Resume Continue
End Sub

Sheet 7:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.CountLarge = 1 And Not Intersect(Range("E5:J8"), Target) Is Nothing Then
On Error GoTo Escape
Application.EnableEvents = False
Target.Copy Sheet6.Range(Target.Address).Offset(14, -1) '<-- *** Sheet code name used ***
End If
Continue:
Application.EnableEvents = True
Exit Sub
Escape:
MsgBox "Error " & Err.Number & ": " & Err.Description
Resume Continue
End Sub
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
For sheet 6, the Target must not be in rows 1 to 14.
 
Upvote 0
I can't get your code to generate that error. You might need to share your workbook via one of the file sharing platforms.
Do you have anything unusual in the 2 ranges that you are targetting ?
I have tried merging cells and protecting the sheet and while they produce the 1004 error they have a disctinctive message with it.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top