LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Spreadsheet name = cell content?

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1:A10" '<=== change to suit
Dim sh As Worksheet

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
On Error Resume Next
Set sh = Worksheets(Target.Value)
On Error GoTo 0
If sh Is Nothing Then
Worksheets.Add(after:=Worksheets(Worksheets.Count) ).Name = Target.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 Phillips

(replace somewhere in email address with gmail if mailing direct)

"Tester" wrote in message
...
Hi - can a spreadsheet name within a workbook be told to reflect a cell
value please?

I have a list of suppliers in a column on a control sheet. this list is
dynamic due to adding new suppliers and i would like a spreadsheet for

each
supplier in alphabetical order. I'm thinking that if the spreadsheet names
could be = to a cell content, the workbook will always be alphabetical.

TIA
Chris




 
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 link for both content and format of the cell? Becky Excel Worksheet Functions 1 October 27th 06 01:43 AM
Help with this conditional IF statement C-Dawg Excel Discussion (Misc queries) 3 May 15th 06 06:01 PM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
One spreadsheet cell won't print but shows up in print preview? Sally Excel Discussion (Misc queries) 1 May 26th 05 07:06 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


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

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"