Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Custom List to Define Sheet Tab Names
Would like to use a custom list, or a range name, or simply a range with
names to define my worksheet names via VBA; can do? -- Marv Lusk Boise Corporation |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Custom List to Define Sheet Tab Names
Sub tester()
Dim iWS As Integer Dim rNames As Range Set rNames = Range("myNames") For iWS = 1 To rNames.Count Worksheets(iWS).Name = rNames(iWS) Next iWS End Sub (no error trapping) HTH -- AP "MarvInBoise" a écrit dans le message de news: ... Would like to use a custom list, or a range name, or simply a range with names to define my worksheet names via VBA; can do? -- Marv Lusk Boise Corporation |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Custom List to Define Sheet Tab Names
Marv,
Here is one way. In this example, I have assumed that the first item in the list is TabNames, so that we can pinpoint the list Dim i As Long, j As Long Dim ary For i = 1 To Application.CustomListCount ary = Application.GetCustomListContents(i) If ary(LBound(ary)) = "TabNames" Then For j = 2 To UBound(ary) If j - 1 <= ActiveWorkbook.Worksheets.Count Then Worksheets(j - 1).Name = ary(j) End If Next j End If Next i -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "MarvInBoise" wrote in message ... Would like to use a custom list, or a range name, or simply a range with names to define my worksheet names via VBA; can do? -- Marv Lusk Boise Corporation |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Custom List to Define Sheet Tab Names
Perfect! Thanks so much!
-- Marv Lusk Boise Corporation "Ardus Petus" wrote: Sub tester() Dim iWS As Integer Dim rNames As Range Set rNames = Range("myNames") For iWS = 1 To rNames.Count Worksheets(iWS).Name = rNames(iWS) Next iWS End Sub (no error trapping) HTH -- AP "MarvInBoise" a écrit dans le message de news: ... Would like to use a custom list, or a range name, or simply a range with names to define my worksheet names via VBA; can do? -- Marv Lusk Boise Corporation |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do i set up a list of names on a sheet frm various sheets in e | Excel Discussion (Misc queries) | |||
Putting Sheet Names on a list | Excel Programming | |||
Creating list of sheet names | Excel Programming | |||
Can you sort a list based on catagory names without useing a custom list? | Excel Programming | |||
VBA to insert list of sheet names | Excel Programming |