Naming a worksheet help?

  • Thread starter Thread starter pauldaddyadams
  • Start date Start date
P

pauldaddyadams

HI,

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

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

Pau
 
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 ]
 
Back
Top