how to put cell information as filename

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have several worksheets that I use for team stats. I want to be able to
take the name off my roster sheet and use it as a name for the players
individual stats sheet. Is this possible? How?
 
Do you mean you want to save the individual worksheet in a new file named
according to the name of the worksheet?
 
ok, i have a spreadsheet with about 50 worksheets. the first 20 or so are
individual games with stats. the next 20-25 are for individual player stats.
the final few pages are things like schedule, roster, team stats, etc.

What i am trying to do is: when i fill in the roster, lets say A1 on the
roster is named Player One. I want whatever I put in A1 to be the name of
the worksheet for Player One's stats. Hope this helps.
 
locke, the solution depends on whether the worksheet for player one's stats
already exists and always resides in the same order within the worksheets
(and you just want to rename that sheet), or whether you want to create a
new sheet for Player One. James
 
the sheet already exists and is in the same basic order and i just want to
have the sheet renamed to match the name on the roster
 
Say you want to name your second worksheet with the value in cell A1, the
third worksheet with the value in A2, and so on. Copy this code and paste
it in a standard module:

Sub NameShts()
With ThisWorkbook
.Worksheets(2).Name = [a1]
.Worksheets(3).Name = [a2]
End With
End Sub

Or, say you have 20 names in column A and you want to name the sheets
beginning with the 5th sheet after those 20 names, use something like this
instead:
..
Sub NameShtsA()
With ThisWorkbook
For k=1 to 20
.Worksheets(5+k).Name = cells(k,"a")
Next k
End With
End Sub

Be sure you are on the worksheet with the name list when you run the macro.
If you have a blank cell in one of the 20 cells, you'll get an error. If
there are more names than sheets, you'll get an error.
HTH, James
 
finally....i've been trying to do this now for 3 years. i've been manually
changing all the page names each year and for each sport.

thanks very much, with a little manipulation, its working wonderfully
 
Back
Top