RT Error 1004 During a Macro run

gemcgraw

Board Regular
Joined
Mar 11, 2011
Messages
70
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
 

Some videos you may like

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

doofusboy

Well-known Member
Joined
Oct 14, 2003
Messages
1,325
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])
 

gemcgraw

Board Regular
Joined
Mar 11, 2011
Messages
70
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,109,523
Messages
5,529,334
Members
409,863
Latest member
stacy09
Top