Field value defines worksheet name

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.
 
N

Nigel

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
 
G

gdf1903

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top