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
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi Alex,

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

Mark
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0
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.
 
Upvote 0
Thanks Mark, at least I know this is a dead end :)..And I like the suggestion a lot, I might just pursue it.

Alex
 
Upvote 0
You are most welcome:) Just as I was unclear, a one-column listbox, multiselect=TRUE, listing all the worksheets in the workbook.
 
Upvote 0

Forum statistics

Threads
1,214,377
Messages
6,119,185
Members
448,872
Latest member
lcaw

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