Keep specific worksheets in a particular order within workbook

Jak

Well-known Member
Joined
Apr 5, 2002
Messages
833
Hi all

Just a quick question on worksheet order. Is there a way to keep specific worksheet in a particular order via VBA.

Example.

Sheet1, Sheet2, Returns, Log, SLAs

In a shared workbook, the worksheet names: "Returns", "Log", "SLAs" need to be the last three worksheets on the right hand side of the workbook. When users add additional worksheets, this changes the ordering ie.

Sheet1, Sheet2, Returns, Log, SLAs, Sheet4

Is it possible to search for these sheet names and move them as outlined above when the workbook is opened?
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Here's one way. You could also do in Workbook_BeforeClose or Workbook_BeforeSave.

Code:
Private Sub Workbook_Open()
    Sheets("Returns").Move After:=Sheets(Worksheets.Count)
    Sheets("Log").Move After:=Sheets(Worksheets.Count)
    Sheets("SLAs").Move After:=Sheets(Worksheets.Count)
End Sub
 
Upvote 0
Hi JamesW and doofusboy

Thanks for your help on this. Greatly appreciated.

Jak
 
Upvote 0

Forum statistics

Threads
1,224,594
Messages
6,179,792
Members
452,942
Latest member
VijayNewtoExcel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top