Field value defines worksheet name

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

Hi,

I want to make a worksheet name in Excel 2003 equal the value of a
field in the same worksheet. Is this possible? I see a few ways of
doing it the other way round. The field is a date format and I need
this to be the name of the worksheet.

Thanks,

Gary.
 
One solution, given a date in cell A1, you cannot name a sheet with the
following characters \ / ? * [ ]
by using the date and format you can eliminate the default / used in dates.

With ActiveSheet.Range("A1")
If IsDate(.Range("A1")) Then ActiveSheet.Name = Format(.Range("A1"),
"dd-mm-yyyy")
End With
 
One solution, given a date in cell A1, you cannot name a sheet with the
following characters \ / ? * [ ]
by using the date and format you can eliminate the default / used in dates.

With ActiveSheet.Range("A1")
   If IsDate(.Range("A1")) Then  ActiveSheet.Name = Format(.Range("A1"),
"dd-mm-yyyy")
End With

--

Regards,
Nigel
(e-mail address removed)




I want to make a worksheet name in Excel 2003 equal the value of a
field in the same worksheet. Is this possible? I see a few ways of
doing it the other way round. The field is a date format and I need
this to be the name of the worksheet.

Gary.- Hide quoted text -

- Show quoted text -

Thanks for this. How would this be programmed into Excel? I know how
to attach code to buttons, but how would this work?

Thanks.
 
Back
Top