ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Field value defines worksheet name (https://www.excelbanter.com/excel-programming/427628-field-value-defines-worksheet-name.html)

Gary[_22_]

Field value defines worksheet name
 
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.

Nigel[_2_]

Field value defines worksheet name
 
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




"Gary" wrote in message
...
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.



[email protected]

Field value defines worksheet name
 
On 28 Apr, 09:57, "Nigel" wrote:
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


"Gary" wrote in message

...



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


All times are GMT +1. The time now is 05:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com