View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
John John is offline
external usenet poster
 
Posts: 2,069
Default Naming multiple sheets

You may need to amend some of the code to account for sheets already named
but if starting from scratch this is how i would do it in my total
non-professional capacity as a VBA'er!!

In Sheet1 name the range with the Branch names in, eg Tbl_branches


JB (:

Sub AddSheets()

Dim iNoSheets As Integer
Dim x As Integer
Dim Tbl1 as range
Dim MyBranch$
Set Tbl1 = Tbl_Branches
iNoSheets = Application.InputBox("How many sheets to add?", "Add Sheets",
10, , , , 1)

For x = 1 To iNoSheets
Worksheets.Add
Sheets("sheet" & x).Name = Application.worksheetfunction.index(tbl1,x,1)

Next x

End Sub