Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Excel Worksheet Names

Does anyone know how to name a worksheet based on a row in a specific
worksheet. I have a listing of about 300 items and I need to create a
worksheet for each of these items.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Excel Worksheet Names

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Me.Name = .Value
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
ups.com...
Does anyone know how to name a worksheet based on a row in a specific
worksheet. I have a listing of about 300 items and I need to create a
worksheet for each of these items.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Excel Worksheet Names

You don't have the sheets created yet and you want to create a new sheet for
each name in a range?

You say your "row" has about 300 items.

Are you using Excel 2007?

If not, the maximum items in a row can be 256.

This macro will create a new sheet for each name in row 1 from A1:IV1 in Sheet1

If using 2007, expand the range to suit.

Sub Add_Sheets22()
Dim rCell As Range
For Each rCell In Sheets("Sheet1").Range("A1:IV1")
With Worksheets.Add(After:=Worksheets(Worksheets.Count) )
.Name = rCell.Value
End With
Next rCell
End Sub


Gord Dibben MS Excel MVP

On 19 Apr 2007 06:49:45 -0700, wrote:

Does anyone know how to name a worksheet based on a row in a specific
worksheet. I have a listing of about 300 items and I need to create a
worksheet for each of these items.


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 create a list (Word) of the names on Excel worksheet tabs PT[_2_] Excel Worksheet Functions 3 February 23rd 07 05:24 PM
extracting names, shifts dept from excel worksheet CJ Excel Worksheet Functions 1 December 15th 06 06:41 AM
In Excel, how do I change worksheet headers (A,B) to names (Box)? Tom McGuire New Users to Excel 4 January 18th 06 05:39 PM
How to find hidden names on an Excel worksheet ? Jon Sipworth Excel Worksheet Functions 2 December 13th 05 06:16 PM
How to link Excel worksheet tab names to dates in each worksheet? Pat Excel Worksheet Functions 9 January 31st 05 07:51 AM


All times are GMT +1. The time now is 08:33 AM.

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

About Us

"It's about Microsoft Excel"