Have an excel workbook with several data sheets in addition to 'Reports' that has to be in the 97-03 format.
I need to re-order only the visible sheets by putting the 'last report' at the front.
I've tried several suggestions found on here, but all of them fail with the following error:
Run Time Error 1004: "Move Method of the Worksheet Class Failed"
I've gotten the following Macro to work in the past for this, but it is also generating the same Run Time Error:
Sub BackToTheFuture()
Dim AllShts As Sheets
Dim N As Long
Dim C As Long
Set AllShts = ActiveWorkbook.Sheets
C = AllShts.Count
For N = 1 To (C - 1)
AllShts(C).Move Before:=AllShts(N)
Next
AllShts(1).Select
Set AllShts = Nothing
End Sub
I have a very elementary understanding of the macro functionality, so I'd appreciated any babysteps you could provide.
I need to re-order only the visible sheets by putting the 'last report' at the front.
I've tried several suggestions found on here, but all of them fail with the following error:
Run Time Error 1004: "Move Method of the Worksheet Class Failed"
I've gotten the following Macro to work in the past for this, but it is also generating the same Run Time Error:
Sub BackToTheFuture()
Dim AllShts As Sheets
Dim N As Long
Dim C As Long
Set AllShts = ActiveWorkbook.Sheets
C = AllShts.Count
For N = 1 To (C - 1)
AllShts(C).Move Before:=AllShts(N)
Next
AllShts(1).Select
Set AllShts = Nothing
End Sub
I have a very elementary understanding of the macro functionality, so I'd appreciated any babysteps you could provide.