Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Cgbilliar
 
Posts: n/a
Default Naming Sheets Tabs

I have a workbook that contains a sheet called team data, in that sheet I have
10 players names, Player 1 = F6, Player 2 = F7 right thru were Player10 = F15
and each player has its own sheet, when I write a player's name in tean data F6

I would like for that name to automatically appear on a sheet tab for that
player.

example: sheet team data F6 = sheet 1 tab
sheet team data F7 = sheet 2 tab
right thru where team data F15 = sheet 10 tab

Can someone show me how to do this my window looks like this.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub

I'm very new at this Thanks.


  #2   Report Post  
David McRitchie
 
Posts: n/a
Default

Hi ......,
I'm not sure what you actual goal is, but the following will
create a sheetname when you enter something into column F,
and will put your team name into A1 of the new sheet (if one was created).

Private Sub Worksheet_Change(ByVal Target As Range)
Dim newSht As String, oldSht As String
Dim wsOld As Worksheet, wsNew As Worksheet
If Target.Column < 6 Or Target.Row = 1 Then Exit Sub
oldSht = ActiveSheet.Name
Set wsNew = ActiveSheet
newSht = Target.Text
On Error Resume Next
Sheets(newSht).Activate
If Err.Number = 0 Then 'sheet already exists
Sheets(oldSht).Activate 'reactivate team sheet and exit
Exit Sub
End If
On Error Resume Next
'Create New Sheet
Sheets.Add After:=Sheets(Sheets.Count) '-- place at end
ActiveSheet.Name = newSht
Set wsNew = ActiveSheet
wsNew.Cells(1, 1) = "'" & newSht 'name of new sheet into cell
' Sheets(Sheets.Count).Activate 'try to show last tab
Sheets(oldSht).Activate
End Sub

you can use wsNew. to move things from wsOld
You can look over some additional code snippets in
http://www.mvps.org/dmcritchie/excel/sheets.htm
http://www.mvps.org/dmcritchie/excel/bus_sched.htm
Event Macros
http://www.mvps.org/dmcritchie/excel/event.htm

The newsgroup for programming is
microsoft.public.excel.programming
but by including some code, it was clear you knew how to
set up an event macro.

HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Cgbilliar" wrote in message ...
I have a workbook that contains a sheet called team data, in that sheet I have
10 players names, Player 1 = F6, Player 2 = F7 right thru were Player10 = F15
and each player has its own sheet, when I write a player's name in tean data F6

I would like for that name to automatically appear on a sheet tab for that
player.

example: sheet team data F6 = sheet 1 tab
sheet team data F7 = sheet 2 tab
right thru where team data F15 = sheet 10 tab

Can someone show me how to do this my window looks like this.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub

I'm very new at this Thanks.




  #3   Report Post  
Cgbilliar
 
Posts: n/a
Default

Thanks Dave:
I will apply this information to my program and see what happens.I was afraid
I wasn't making myself clear enough when I was posting this information,I have
written a program that keeps team statistics and individual statistics for the
game of pool (Billiards), I have 10 separate sheets for 10 players and I have
one sheet that keeps the team's data all in one workbook. The problem is at the
beginning of every session I may have new players on the roster which is
located in the team data sheet I would like for each name on this roster of 10
from F6 to F15 to appear on each individual sheet tab for each player so I dont
have to write it again on each sheet tab.
Thanks again, this is all new to me so I am learning as I go.


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
PROTECTING/UNPROTECTING SHEETS Maureen Excel Discussion (Misc queries) 1 January 6th 05 06:46 PM
Multiple sheets selected twa14 Excel Discussion (Misc queries) 2 December 21st 04 11:15 AM
Linking sheets to a summary sheet in workbook gambinijr Excel Discussion (Misc queries) 4 December 16th 04 08:13 PM
Hidding Tabs Aviator Excel Discussion (Misc queries) 1 December 15th 04 04:55 PM
Sheet tabs disappear sometimes in Internet Explorer Jan Nordgreen Excel Discussion (Misc queries) 0 December 6th 04 01:34 AM


All times are GMT +1. The time now is 04:34 AM.

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"