Sheet codename order in VBE

Dr. Demento

Well-known Member
Joined
Nov 2, 2010
Messages
618
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
I have a large number of worksheets (>200) and because Excel places the sheets in order of codename and because the codenames are alphanumeric, I wind up with an order like Sheet1, Sheet100, Sheet101, etc.

Is there a way re-order the sheets so they are in either the same order as the tabs or at least numerically ordered??

Thanks y'all.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
AFAIK the only way would be to change the codenames
 
Upvote 0
I'm not sure what you mean by Excel ordering sheets in order of creation.

This returns the sheet's codenames in the tab order (left-most first)
Code:
Dim oneSheet As Worksheet

For Each oneSheet In ThisWorkbook.Sheets
    MsgBox oneSheet.CodeName
Next oneSheet
 
Upvote 0
I think that the OP is talking about the order of the sheets as seen in the Project window.
 
Upvote 0
Fluff is correct; I was looking at the VBE Projects window.

Appreciate the feedback.
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,213,484
Messages
6,113,927
Members
448,533
Latest member
thietbibeboiwasaco

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