Help with code (delete range)
Hi all,
I want a macro to start at a certain point, move down to the end of the text
and delete the empty space between it and the next populated cells.
Not delete rows, rahter delete cells, shifting up.
I've written:
Sub testdelete()
Range("C5").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveCell.Offset(-1, 0).Select
ActiveCell.Offset(0, 6).Select
Selection.Delete Shift:=xlUp
Range("C11").Select
End Sub
This doesn't work because the .select sets up a new selection rather than
manipulating the old one.
I appreciate this is rookie stuff, but I don't write much VBA, so I've never
got very good at it.
Any ideas gratefully received.
Cheers.
|