ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Naming a worksheet help? (https://www.excelbanter.com/excel-worksheet-functions/39423-naming-worksheet-help.html)

pauldaddyadams

Naming a worksheet help?
 

HI,

I need someones help, im not sure if it can be done but its worth
asking.

Say for Instance in Cell A1 i have the text ''August2005'' I would like
the worksheet to be named this also. Can this be done?

Paul


--
pauldaddyadams
------------------------------------------------------------------------
pauldaddyadams's Profile: http://www.excelforum.com/member.php...o&userid=22499
View this thread: http://www.excelforum.com/showthread...hreadid=394138


Max

Try this worksheet sub from a post by JE:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
ActiveSheet.Name = Range("A1").Value
End If
End Sub

Steps:
Right-click on a sheet tab Choose "View Code"
Clear the defaults in the white space and paste the code there
Type a text* phrase: "August2005" in A1 (the target cell), press Enter
The sheet tab will be named "August2005"

*If you want "August2005" to be the name appearing on the tab
the contents in the target cell A1 need to be either entered as text,
i.e. preceded by an apostrophe [ ' ], or with A1 pre-formatted as Text

Note that sheetnames cannot be duplicates of existing sheets,
contain 31 characters, nor contain illegal character(s): : \ / ? * [
or ]
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"pauldaddyadams"
<pauldaddyadams.1thoyi_1123578343.0273@excelforu m-nospam.com wrote in
message news:pauldaddyadams.1thoyi_1123578343.0273@excelfo rum-nospam.com...

HI,

I need someones help, im not sure if it can be done but its worth
asking.

Say for Instance in Cell A1 i have the text ''August2005'' I would like
the worksheet to be named this also. Can this be done?

Paul


--
pauldaddyadams
------------------------------------------------------------------------
pauldaddyadams's Profile:

http://www.excelforum.com/member.php...o&userid=22499
View this thread: http://www.excelforum.com/showthread...hreadid=394138





All times are GMT +1. The time now is 01:29 AM.

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