Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i set up a list of names on a sheet frm various sheets in e mcvities_69 Excel Discussion (Misc queries) 1 January 27th 06 02:51 AM
Putting Sheet Names on a list arcq Excel Programming 3 March 9th 05 02:49 PM
Creating list of sheet names trickdos[_13_] Excel Programming 1 September 29th 04 07:10 PM
Can you sort a list based on catagory names without useing a custom list? BobbyFlanigan Excel Programming 2 July 29th 04 02:49 AM
VBA to insert list of sheet names Katherine Vale Excel Programming 4 September 1st 03 07:12 PM


All times are GMT +1. The time now is 06:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"