ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Setting up and Configuration of Excel (https://www.excelbanter.com/setting-up-configuration-excel/)
-   -   Autofill Worksheet names (https://www.excelbanter.com/setting-up-configuration-excel/15771-autofill-worksheet-names.html)

Bonnie

Autofill Worksheet names
 
Is there a way in Excel 2000 to rename the first two
worksheets and then use an autofill type feature to add
more worksheets with a series of names? For example, name
one worksheet January, the next one February, then insert
new worksheets that would be automatically named the
consecutive months.

Bonnie

Nick Hodge

Bonnie

No way to do it as you describe, but the code below, if copied to your
personal.xls file will enable you to run the code after setting up the names
on a worksheet and selecting them. (You've described how easy it is to set
up the moths in cells, so you would just do that, highlight the cells and
run the code). It will set up worksheets in the order of the data. (It has
no error checking, so will bomb if you dupe a name or use illegal characters
for example)

Sub AddSheetsWithSelectedNames()
Dim rCell As Range
Dim wks As Worksheet
For Each rCell In Selection
Set wks = Worksheets.Add(After:=Worksheets(Worksheets.Count) )
wks.Name = rCell.Value
Set wks = Nothing
Next rCell
End Sub


--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"Bonnie" wrote in message
...
Is there a way in Excel 2000 to rename the first two
worksheets and then use an autofill type feature to add
more worksheets with a series of names? For example, name
one worksheet January, the next one February, then insert
new worksheets that would be automatically named the
consecutive months.

Bonnie





All times are GMT +1. The time now is 05:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com