Private Sub SetSheetOrder()
'Check Sheet Order
Application.ScreenUpdating = False
If Worksheets("Sheet2").Index = 1 Then
If Worksheets("Sheet1").Index = 2 Then
If Worksheets("Sheet3").Index = 3 Then Exit Sub
End If
End If
'Re-Order Sheets
Worksheets("Sheet2").Move before:=Sheets(1)
Worksheets("Sheet1").Move after:=Sheets(1)
Worksheets("Sheet3").Move after:=Sheets(2)
End Sub
You could add as many layers as you want. If you need to make sure
that they never change the sheets, run this sub in the
Worksheet_Deactivate() sub of each sheet. If you just need to
determine the sheet order before you run some of your own macros, you
only need the Re-Order Sheets portion of the sub and you don't need to
put it in each sheets Worksheet_Deactivate sub.
On Aug 23, 8:08 am, "michael.beckinsale"
<michael.beckins...@ntlworld.com> wrote:
> Hi All,
>
> I wondered if there is a method to disable the moving of sheets other
> than protecting the workbook structure.
>
> Any code to achieve this would be gratefully appreciated
>
> TIA
>
> Michael B
|