View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default Insert Incremental sheet names in a workbook

I'm not aware of a way to protect the sheet names. You could create a macro
to add a sheet at the end.

Try something like this:

Sub AddSheet()
Dim aWB As Workbook
Dim aWS As Worksheet

Set aWB = ActiveWorkbook
Set aWS = Sheets.Add
aWS.Name = "Sheet" & aWB.Worksheets.Count 'You could change "Sheet" to
something else here
aWS.Move after:=Sheets(Sheets.Count)
End Sub

"Sinner" wrote:

I want to have a button on an excel sheet. This button can be on the
sheet or could be on a floating bar, most preferably a floating bar to
reduce workbook size. Name of first worksheet is let's say '1'. On
press it should generate another sheet with name '2' having same
button on sheet '2' as well.

The workbook should also be able to logically detect the last or
greatest sheet number value in the workbook so that the name of the
added sheet is n+1. If sheets are 62,63,64,65,66,67,68 & the last
sheet is 68, then the next sheet should be 69 even if I press the
button on let's say sheet 65.

This workbook may also have other sheets with alphanumeric names like
List8, Bookings etc.
The process should not alter with these sheets.

Finally, to have a sequential sheet names, protection to edit sheet
name is also required form any accidental change of sheet name, like
rename sheet to abc1, abc22, etc.