ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Reverse Worksheets Order (https://www.excelbanter.com/excel-programming/343458-reverse-worksheets-order.html)

Ibro Vehabovic

Reverse Worksheets Order
 
One file has over 50 worksheets and I would like to reverse their order.
Sharing macro to do this automatically would be greatly appreciated.

Thanks,

Ibro V.



Bob Phillips[_6_]

Reverse Worksheets Order
 
Sub reverse()
Dim i As Long

With ActiveWorkbook
For i = .Worksheets.Count - 1 To 1 Step -1
Worksheets(i).Move after:=.Worksheets(.Worksheets.Count)
Next i
End With

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ibro Vehabovic" wrote in message
...
One file has over 50 worksheets and I would like to reverse their order.
Sharing macro to do this automatically would be greatly appreciated.

Thanks,

Ibro V.





Ibro Vehabovic

Reverse Worksheets Order
 
Thanks Bob

Ibro V.

"Bob Phillips" wrote in message
...
Sub reverse()
Dim i As Long

With ActiveWorkbook
For i = .Worksheets.Count - 1 To 1 Step -1
Worksheets(i).Move after:=.Worksheets(.Worksheets.Count)
Next i
End With

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ibro Vehabovic" wrote in message
...
One file has over 50 worksheets and I would like to reverse their order.
Sharing macro to do this automatically would be greatly appreciated.

Thanks,

Ibro V.







Gary Keramidas

Reverse Worksheets Order
 
that was pretty cool, bob

--


Gary


"Bob Phillips" wrote in message
...
Sub reverse()
Dim i As Long

With ActiveWorkbook
For i = .Worksheets.Count - 1 To 1 Step -1
Worksheets(i).Move after:=.Worksheets(.Worksheets.Count)
Next i
End With

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ibro Vehabovic" wrote in message
...
One file has over 50 worksheets and I would like to reverse their order.
Sharing macro to do this automatically would be greatly appreciated.

Thanks,

Ibro V.








All times are GMT +1. The time now is 10:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com