R
Risky Dave
Hi,
I have a macro that is intended to find an entry on one sheet and cut and
pastes it into the next empty line on another sheet.
I am getting the dreaded runtime 1004 with the message "Cut method of range
class failed"
The specific piece of code (part of a much larger macro) is:
If rTargetCell.Value = "" Then ' move database entry to Archive
iTgt = rTargetCell.Row
Sheets("Database").Range(iSource & ":" &
iSource).cut_ Destination:=Sheets("archive").Range(iTgt & ":" & iTgt)
Worksheets("Database").Activate
Range("a" & iSource & ":ah" &
iSource).Select
Selection.Delete Shift:=xlUp
The error is being generated at the line that starts
Sheets("Database").Range......
All the appropriate variables have been set earlier.
I think I need to specifically activate the recipient sheet, but I'm not
sure how to do this (based on similar errors elsewhere in these forums).
Any suggestions would be gratefully received.
This is in Office 2003 under Windows 2000, if that makes a difference
TIA
Dave
I have a macro that is intended to find an entry on one sheet and cut and
pastes it into the next empty line on another sheet.
I am getting the dreaded runtime 1004 with the message "Cut method of range
class failed"
The specific piece of code (part of a much larger macro) is:
If rTargetCell.Value = "" Then ' move database entry to Archive
iTgt = rTargetCell.Row
Sheets("Database").Range(iSource & ":" &
iSource).cut_ Destination:=Sheets("archive").Range(iTgt & ":" & iTgt)
Worksheets("Database").Activate
Range("a" & iSource & ":ah" &
iSource).Select
Selection.Delete Shift:=xlUp
The error is being generated at the line that starts
Sheets("Database").Range......
All the appropriate variables have been set earlier.
I think I need to specifically activate the recipient sheet, but I'm not
sure how to do this (based on similar errors elsewhere in these forums).
Any suggestions would be gratefully received.
This is in Office 2003 under Windows 2000, if that makes a difference
TIA
Dave