How do I reverse page order in excel workbook?

G

Guest

I need to reverse the order of dozens of pages in an Excel workbook. I would
appreciate any advice. Thanks!
 
A

Andrew Taylor

If by "pages" you mean (work)sheets, the following macro will
do the trick (assuming no hidden sheets)

Sub ReverseSheets()
Dim s As Object, i As Integer, iNumSheets As Integer
iNumSheets = ActiveWorkbook.Sheets.Count
For i = 1 To iNumSheets
Set s = ActiveWorkbook.Sheets(1)
s.Move after:=ActiveWorkbook.Sheets(iNumSheets - i + 1)
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top