This is the code:
Dim rngReason As Range, rngDest As Variant
Set rngDest = wksRemoved.Range("A1").CurrentRegion
Set rngDest = rngDest.Cells(rngDest.Rows.Count + 1, 1)
Set rngReason = Range("A1").CurrentRegion
Set rngReason = rngReason.Columns(rngReason.Columns.Count).offset(0, 1)
Set rngReason = Intersect(rngReason, rngDupeRows)
rngReason.Cells.Value2 = "Duplicate " & strDedupeField
''Fails here with the error message:
'' Copy method of range class failed
rngDupeRows.Copy Destination:=rngDest
rngDupeRows
is a range. The values of rngDupeRows
and rngDest
addresses at the time of the error are:
rngDest.Address "$A$2" Variant/String
rngDupeRows.Address "$3:$98301" String
The purpose of the code is to copy rows from one workbook and paste them into another. I've ran this multiple times on different ranges and it works fine.
Any ideas what the reason for the error might be?