I need to delete two rows at a time starting with row 4 and then skip a row and delete the next two rows etc. So I need to delete rows 4 & 5, 7 & 8, 10 & 11 and so on... I created the following code, but it is giving me an error saying "method range failed.." Any help would be very appreciated. Here's my code.
Sub Macro1()
Dim i As Integer
For i = 4 To 2000
Range("i:i + 1"
.Select
i = i + 2
Next i
Selection.Delete Shift:=xlUp
End Sub
The reason I need to do this is I need to import a file that is in excel into an access database, but the records in excel are wrapped so that about half of each record is wrapped over to the next row.
for example..
LISTNAME CLIENT QTY SHIP USE
Offer Type Order # Mail Date
I copied and pasted the whole range side by side and then deleted a row of cells above the second set to line up the data, now I need to delete the extra data lines that exist and what to find out a easy way to do it in code. If anyone has any better ideas to combine the two rows into one, that would be great!!
Thanks
Sub Macro1()
Dim i As Integer
For i = 4 To 2000
Range("i:i + 1"
i = i + 2
Next i
Selection.Delete Shift:=xlUp
End Sub
The reason I need to do this is I need to import a file that is in excel into an access database, but the records in excel are wrapped so that about half of each record is wrapped over to the next row.
for example..
LISTNAME CLIENT QTY SHIP USE
Offer Type Order # Mail Date
I copied and pasted the whole range side by side and then deleted a row of cells above the second set to line up the data, now I need to delete the extra data lines that exist and what to find out a easy way to do it in code. If anyone has any better ideas to combine the two rows into one, that would be great!!
Thanks