View Single Post
  #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.