RT Error 1004 During a Macro run

gemcgraw

Board Regular
Joined
Mar 11, 2011
Messages
72
I was attempting to run a macro to copy rows from one sheet to another based on a "IF" condition. I get the following Run-Time error '1004':
"The information cannot be pasted because the Copy area and the Paste area are not the same size and shape. Try one of the following:
Click a single cell, and then paste. Select a rectangle that's the same size and shape, and then paste." I'm presuming that the Source sheet is the active sheet the macro is looking at? Else, how do I designate a 'source' sheet? The error is true; I have data in the source sheet of A2:AF905. Sheet5 or named "CURR-FILTER" is basicaly blank.

Here is the macro that I am running:

Code:
Sub MoveNonDrop()
 
Dim couNter As Long
Dim RowCount As Long
 
Application.ScreenUpdating = False
RowCount = 905
couNter = 2
Do Until couNter > RowCount
If Not Range("A" & couNter).Value = "DROPPED" Then
Range("A" & couNter).EntireRow.Copy Destination:=Sheet5. _
Range("A" & couNter).End(xlDown).Offset(1, 1)
RowCount = RowCount + 1
couNter = couNter + 1
End If
couNter = couNter + 1
Loop
Application.ScreenUpdating = True
End Sub
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Have you tried adjusting your offset as highlighted in red below?

Code:
Range("A" & couNter).EntireRow.Copy Destination:=Sheet5. _
Range("A" & couNter).End(xlDown).Offset(1, [B][COLOR=red]0[/COLOR][/B])
 
Upvote 0
Have you tried adjusting your offset as highlighted in red below?

Code:
Range("A" & couNter).EntireRow.Copy Destination:=Sheet5. _
Range("A" & couNter).End(xlDown).Offset(1, [B][COLOR=red]0[/COLOR][/B])
I did modify my code changing the Offset parameter from (1,1) to (1,0) and it appears to be running clean through the code now; however, it is not writing (copy/pasting) any rows to my new Sheet5 or "CURR-FILTER", as I have the tab named.
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,286
Members
449,076
Latest member
kenyanscott

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