PDA

View Full Version : Solved: Reversing the order of rows???



twelvety
03-03-2009, 03:41 AM
Hi experts,
I have found out through this forum that I can reverse the order of columns using this code;



Sub reverse()
Dim counti As Integer
Dim countj As Integer


Application.ScreenUpdating = False
counti = Cells(Selection.Row, Columns.Count).End(xlToLeft).Column
For countj = counti - 1 To 1 Step -1
Columns(countj).Cut
Columns(counti + 1).Insert
Next countj
Application.ScreenUpdating = True
End Sub


Is anyone able to provide me with some code to reverse the order of rows?

Thanks in advance

Bob Phillips
03-03-2009, 04:18 AM
Sub reverse()
Dim counti As Integer
Dim countj As Integer
Application.ScreenUpdating = False
counti = Cells(Rows.Count, Selection.Column).End(xlUp).Row
For countj = counti - 1 To 1 Step -1
Rows(countj).Cut
Rows(counti + 1).Insert
Next countj
Application.ScreenUpdating = True
End Sub