Starting sheet numbering with Sheet1

AlexCS

Board Regular
Joined
Oct 31, 2011
Messages
78
Hi everyone,

I have a worksheet in which I am inserting a variable number of new sheets monthly. I need the inserted sheets to always start with Sheet1, Sheet2 etc for further code to work (if you inserted Sheet1 and deleted it, newly generated sheets would start numbering with Sheet2 unless you close and re-open the document)

Does anyone know how to restart the sheet numbering without closing and re-opening the document?

Any help would be much appreciated,

Thanks,

Alex
 

Some videos you may like

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

GTO

MrExcel MVP
Joined
Dec 9, 2008
Messages
6,154
Hi Alex,

Are the new sheets being created/inserted manually or via code.

Mark
 

AlexCS

Board Regular
Joined
Oct 31, 2011
Messages
78
Hi Mark,

Thanks for looking into this. The new sheets are being generated with VBA code via an input box where the user specifies the number of new tabs he needs.

Alex
 

GTO

MrExcel MVP
Joined
Dec 9, 2008
Messages
6,154
Sorry, I should have asked a couple of questions straightaway.

Are we by chance deleting the "same" sheets (via code) that we will re-create? eg - the code deletes: 'Sheet1', 'Sheet2' and then we want to create 'Sheet1' and 'Sheet2' (referring to the sheets' tabnames), or...

Might we be deleting more (or less) sheets than we are about to create?

Mark
 

AlexCS

Board Regular
Joined
Oct 31, 2011
Messages
78

ADVERTISEMENT

Hi Mark,

Yes, you are right..I am deleting (though manually still), the same sheets I am trying to re-create..I know the Excel default is to not re-start numbering and I was wondering if there is a way around this.

Many thanks,

Alex
 

GTO

MrExcel MVP
Joined
Dec 9, 2008
Messages
6,154
Sorry Alex, that's a no. If you add a userform with a listbox and list the worksheets to delete (and re-create), that would probably work out.
 

AlexCS

Board Regular
Joined
Oct 31, 2011
Messages
78

ADVERTISEMENT

Thanks Mark, at least I know this is a dead end :)..And I like the suggestion a lot, I might just pursue it.

Alex
 

GTO

MrExcel MVP
Joined
Dec 9, 2008
Messages
6,154
You are most welcome:) Just as I was unclear, a one-column listbox, multiselect=TRUE, listing all the worksheets in the workbook.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,567
Messages
5,625,550
Members
416,116
Latest member
Joemamasuka

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
Top