View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
joel[_659_] joel[_659_] is offline
external usenet poster
 
Posts: 1
Default add rows to a sheet


I don't know if you have a header row. The code below assumes there is
not header row. Let me know if there is a header row and I will make a
couple of minor changes.


Sub MoveRows()

LastRow = Range("A" & Rows.Count).End(xlUp).Row
For RowCount = LastRow To 1 Step -1
RowIndex = Range("A" & RowCount)
If RowIndex < RowCount Then
Rows(RowCount).Copy Destination:=Rows(RowIndex)
Rows(RowCount).ClearContents
End If
Next RowCount
End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=178433

Microsoft Office Help