View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jeff Saunders Jeff Saunders is offline
external usenet poster
 
Posts: 2
Default How to make worksheet names dynamic?

Jason,

Thanks, but i have a slight challenge. The formula works for words, but not
dates. In cell a1 I have the data January 1, 2008 and it shows as January
2008. That does not want to show up in the sheet name tab. If I put a word
in A1 it works great, any suggestions.
]
Thanks.

Jeff

"Jason Morin" wrote:

Assuming your target cell for the sheet name is B1, right-click on the
worksheet tab, select View Code, and paste in the following:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Me.[B1], Target) Is Nothing Then
On Error GoTo InvalidName
Me.Name = Target.Value
Exit Sub
End If
InvalidName:
MsgBox "Invalid sheet name."
End Sub

---
Press ALT+Q to close the VBE.

HTH
Jason
Atlanta, GA


"Neil Mitchell-Goodson" wrote:

In Excel 2003, is there any way to name a worksheet according to user input
in the sheet itself? So if I had a sheet with figures on it, and I specify a
cell to input say, the 'year', that the worksheet would then adopt it's name
from that input?