VBA to order sheet tab according to months...

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Is there a way for VBA to order sheet tab according to months...

My sheet names are in month name as "Jan","Feb","Mar" and so on till "dec"...

I always want sheet tab to stay in month order...

Thanks for helping
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Code:
Sub forceMonthOrder()
    Sheets("Jan").Move Before:=Sheets("Feb")
    Sheets("Feb").Move Before:=Sheets("Mar")
    Sheets("Mar").Move Before:=Sheets("Apr")
    Sheets("Apr").Move Before:=Sheets("May")
    Sheets("May").Move Before:=Sheets("Jun")
    Sheets("Jun").Move Before:=Sheets("Jul")
    Sheets("Jul").Move Before:=Sheets("Aug")
    Sheets("Aug").Move Before:=Sheets("Sep")
    Sheets("Sep").Move Before:=Sheets("Oct")
    Sheets("Oct").Move Before:=Sheets("Nov")
    Sheets("Nov").Move Before:=Sheets("Dec")
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,530
Messages
6,179,373
Members
452,907
Latest member
Roland Deschain

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