Missing Sheet Code Name

indyman

New Member
Joined
Apr 14, 2021
Messages
47
Office Version
  1. 2019
Platform
  1. Windows
I have a very strange problem. I have a workbook with sheets 1 - 18. But there is no Sheet11 showing in Project Explorer. If I debug.print looping through all the sheets none of the code names come back wit Sheet11. However, I have msgbox that runs on Workbook>Open that is not happening at the proper timing. So I did a search for the msgbox text and I find it on Sheet14 (as I expect), but I also find it on Sheet11. Sheet14 is a User Intro. But Sheet11 does not show up. I can wipe out the code on 11, but the fact that Excel thinks there is an 11 troubles me.

To make matters more fun, a previous backup of this workbook, the User Intro is Sheet11. But that workbook is missing Sheet12. This has been a development measured in months. And I went through a few major redesigns and sheet renaming to re-order the sheets in the Project Explorer window (yep, a little OCD). So no doubt things have been moved around a bit. I have 1000's of lines of VBA, but doubt that plays a role here. I run VBA Code Cleaner often. And the sheet is not visible or hidden. one more bit of info.

I am using 13 customUI ribbon controls. I will randomly have the workbook crash close upon clicking a control (in about 1 out of 20 clicks), but never the same control, and yet to be reproducible.

Just for fun, I am going to ask the question I think I already know the answer. Is there a fix for this? Or this only explainable as a corrupt workbook? Anyone see something like this before? For now I am just going to grab a couple strong drinks and call it a day.
 
I tend to just use the code names, rather than using variables.
But one thing to consider is that as you add/delete sheets the codenames work in the same way as sheet names.
Because of this I change the codenames to reflect the sheet. So for instance if I had a sheet called Data I would change the codename to cnData.
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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