SonicBoomGolf
Active Member
- Joined
- Aug 7, 2004
- Messages
- 325
I am having a problem with the following code.
Public Sub OrderSummary()
botrw = 55
' Inserts a New Column in Column A
With Range("a:a").Select
Selection.Insert shift:=xlToRight
End With
Do
toprw = Range("m" & botrw).End(xlDown).Row
botrw = Range("m" & toprw).End(xlDown).Row
Cells(toprw - 1, 2).Cut
Range(Cells(toprow, 2), Cells(botrw - 2, 2)).Paste
Loop Until botrw = Cells(65536, 2).End(xlUp).Row
End Sub
I get a Run-Time 1004 Error when it comes to this portion of the code:
Range(Cells(toprow, 2), Cells(botrw - 2, 2)).Paste
I don't understand what is wrong with this. Any ideas?
Public Sub OrderSummary()
botrw = 55
' Inserts a New Column in Column A
With Range("a:a").Select
Selection.Insert shift:=xlToRight
End With
Do
toprw = Range("m" & botrw).End(xlDown).Row
botrw = Range("m" & toprw).End(xlDown).Row
Cells(toprw - 1, 2).Cut
Range(Cells(toprow, 2), Cells(botrw - 2, 2)).Paste
Loop Until botrw = Cells(65536, 2).End(xlUp).Row
End Sub
I get a Run-Time 1004 Error when it comes to this portion of the code:
Range(Cells(toprow, 2), Cells(botrw - 2, 2)).Paste
I don't understand what is wrong with this. Any ideas?