PC Review


Reply
Thread Tools Rate Thread

automatically change worksheet tab name

 
 
wally
Guest
Posts: n/a
 
      26th Jun 2008
I have 16 sheets that are numbered 1 thru 16 on the tab. I also have a
17th sheet I have renamed "Data" (ignore quotes). I would like to type
a name, (i.e., wonder) into cell a1 of the Data sheet and have that
automatically change the name of sheet number 1 to "wonder". Then I
would type another name (i.e., Hanger) into on the data sheet into
cell a2 and that would change sheet number 2 to Hanger. I would
continue to do this until all sheets are now changed to a name rather
than a numer. Can this be accomplished by a formula?
Thank you, Wally
 
Reply With Quote
 
 
 
 
PCLIVE
Guest
Posts: n/a
 
      26th Jun 2008
This will need to be done using VBA.

Press Alt+F11 to enter the VB Editor.
On the left, you should see your workbook listed as
"VBAProject(YourWorkbook)". If there is a plus to the left of it, click it
to make it a minus which expands the list as well. Do the same thing for
"Microsoft Excel Objects".
Double-click on ThisWorkbook.
Paste the following code in the right-hand pane.


Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Stop
If ActiveSheet.Name = "Data" And Sheets(Target.Row).Name <> "Data" _
Then
If Target.Column = 1 And Target.Value <> "" Then
Sheets(Target.Row).Name = Target.Value
Else
End If
End Sub


HTH,
Paul


--

"wally" <(E-Mail Removed)> wrote in message
news:567a2bea-a230-4168-b20c-(E-Mail Removed)...
>I have 16 sheets that are numbered 1 thru 16 on the tab. I also have a
> 17th sheet I have renamed "Data" (ignore quotes). I would like to type
> a name, (i.e., wonder) into cell a1 of the Data sheet and have that
> automatically change the name of sheet number 1 to "wonder". Then I
> would type another name (i.e., Hanger) into on the data sheet into
> cell a2 and that would change sheet number 2 to Hanger. I would
> continue to do this until all sheets are now changed to a name rather
> than a numer. Can this be accomplished by a formula?
> Thank you, Wally



 
Reply With Quote
 
wally
Guest
Posts: n/a
 
      26th Jun 2008
On Jun 26, 4:12*pm, "PCLIVE" <pclive(RemoveThis)@cox.net> wrote:
> This will need to be done using VBA.
>
> Press Alt+F11 to enter the VB Editor.
> On the left, you should see your workbook listed as
> "VBAProject(YourWorkbook)". If there is a plus to the left of it, click it
> to make it a minus which expands the list as well. Do the same thing for
> "Microsoft Excel Objects".
> Double-click on ThisWorkbook.
> Paste the following code in the right-hand pane.
>
> Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
> Stop
> If ActiveSheet.Name = "Data" And Sheets(Target.Row).Name <> "Data" _
> * * Then
> * * * * If Target.Column = 1 And Target.Value <> "" Then
> Sheets(Target.Row).Name = Target.Value
> * * Else
> End If
> End Sub
>
> HTH,
> Paul
>
> --
>
> "wally" <ruwa...@att.net> wrote in message
>
> news:567a2bea-a230-4168-b20c-(E-Mail Removed)...
>
>
>
> >I have 16 sheets that are numbered 1 thru 16 on the tab. I also have a
> > 17th sheet I have renamed "Data" (ignore quotes). I would like to type
> > a name, (i.e., wonder) into cell a1 of the Data sheet and have that
> > automatically change the name of sheet number 1 to "wonder". Then I
> > would type another name (i.e., Hanger) into on the data sheet into
> > cell a2 and that would change sheet number 2 to Hanger. I would
> > continue to do this until all sheets are now changed to a name rather
> > than a numer. Can this be accomplished by a formula?
> > Thank you, Wally- Hide quoted text -

>
> - Show quoted text -


Hi Paul,
Followed your instructions but when I type in a name in cell A1 on
sheet Data, nothing happens. I go to VBA and the first line (Private
Sub Workbook, etc) is highlighted in yellow.
Wally
 
Reply With Quote
 
PCLIVE
Guest
Posts: n/a
 
      26th Jun 2008
Oops. Sorry about that.
Remove "Stop" from the beginning of the code. That was there for testing
purposes.



--

"wally" <(E-Mail Removed)> wrote in message
news:6acf8fcc-9641-476d-b6af-(E-Mail Removed)...
On Jun 26, 4:12 pm, "PCLIVE" <pclive(RemoveThis)@cox.net> wrote:
> This will need to be done using VBA.
>
> Press Alt+F11 to enter the VB Editor.
> On the left, you should see your workbook listed as
> "VBAProject(YourWorkbook)". If there is a plus to the left of it, click it
> to make it a minus which expands the list as well. Do the same thing for
> "Microsoft Excel Objects".
> Double-click on ThisWorkbook.
> Paste the following code in the right-hand pane.
>
> Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
> Range)
> Stop
> If ActiveSheet.Name = "Data" And Sheets(Target.Row).Name <> "Data" _
> Then
> If Target.Column = 1 And Target.Value <> "" Then
> Sheets(Target.Row).Name = Target.Value
> Else
> End If
> End Sub
>
> HTH,
> Paul
>
> --
>
> "wally" <ruwa...@att.net> wrote in message
>
> news:567a2bea-a230-4168-b20c-(E-Mail Removed)...
>
>
>
> >I have 16 sheets that are numbered 1 thru 16 on the tab. I also have a
> > 17th sheet I have renamed "Data" (ignore quotes). I would like to type
> > a name, (i.e., wonder) into cell a1 of the Data sheet and have that
> > automatically change the name of sheet number 1 to "wonder". Then I
> > would type another name (i.e., Hanger) into on the data sheet into
> > cell a2 and that would change sheet number 2 to Hanger. I would
> > continue to do this until all sheets are now changed to a name rather
> > than a numer. Can this be accomplished by a formula?
> > Thank you, Wally- Hide quoted text -

>
> - Show quoted text -


Hi Paul,
Followed your instructions but when I type in a name in cell A1 on
sheet Data, nothing happens. I go to VBA and the first line (Private
Sub Workbook, etc) is highlighted in yellow.
Wally


 
Reply With Quote
 
wally
Guest
Posts: n/a
 
      26th Jun 2008
I removed stop and the same thing happens.

On Jun 26, 5:03*pm, "PCLIVE" <pclive(RemoveThis)@cox.net> wrote:
> Oops. *Sorry about that.
> Remove "Stop" from the beginning of the code. *That was there for testing
> purposes.
>
> --
>
> "wally" <ruwa...@att.net> wrote in message
>
> news:6acf8fcc-9641-476d-b6af-(E-Mail Removed)...
> On Jun 26, 4:12 pm, "PCLIVE" <pclive(RemoveThis)@cox.net> wrote:
>
>
>
>
>
> > This will need to be done using VBA.

>
> > Press Alt+F11 to enter the VB Editor.
> > On the left, you should see your workbook listed as
> > "VBAProject(YourWorkbook)". If there is a plus to the left of it, clickit
> > to make it a minus which expands the list as well. Do the same thing for
> > "Microsoft Excel Objects".
> > Double-click on ThisWorkbook.
> > Paste the following code in the right-hand pane.

>
> > Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
> > Range)
> > Stop
> > If ActiveSheet.Name = "Data" And Sheets(Target.Row).Name <> "Data" _
> > Then
> > If Target.Column = 1 And Target.Value <> "" Then
> > Sheets(Target.Row).Name = Target.Value
> > Else
> > End If
> > End Sub

>
> > HTH,
> > Paul

>
> > --

>
> > "wally" <ruwa...@att.net> wrote in message

>
> >news:567a2bea-a230-4168-b20c-(E-Mail Removed)....

>
> > >I have 16 sheets that are numbered 1 thru 16 on the tab. I also have a
> > > 17th sheet I have renamed "Data" (ignore quotes). I would like to type
> > > a name, (i.e., wonder) into cell a1 of the Data sheet and have that
> > > automatically change the name of sheet number 1 to "wonder". Then I
> > > would type another name (i.e., Hanger) into on the data sheet into
> > > cell a2 and that would change sheet number 2 to Hanger. I would
> > > continue to do this until all sheets are now changed to a name rather
> > > than a numer. Can this be accomplished by a formula?
> > > Thank you, Wally- Hide quoted text -

>
> > - Show quoted text -

>
> Hi Paul,
> Followed your instructions but when I type in a name in cell A1 on
> sheet Data, nothing happens. I go to VBA and the first line (Private
> Sub Workbook, etc) is highlighted in yellow.
> Wally- Hide quoted text -
>
> - Show quoted text -


 
Reply With Quote
 
PCLIVE
Guest
Posts: n/a
 
      26th Jun 2008
If you're not getting an error, while you've got the VBA window open and you
see the highlighted line, try pressing F5.

--

"wally" <(E-Mail Removed)> wrote in message
news:d1fd75d5-13ae-4721-b4ce-(E-Mail Removed)...
I removed stop and the same thing happens.

On Jun 26, 5:03 pm, "PCLIVE" <pclive(RemoveThis)@cox.net> wrote:
> Oops. Sorry about that.
> Remove "Stop" from the beginning of the code. That was there for testing
> purposes.
>
> --
>
> "wally" <ruwa...@att.net> wrote in message
>
> news:6acf8fcc-9641-476d-b6af-(E-Mail Removed)...
> On Jun 26, 4:12 pm, "PCLIVE" <pclive(RemoveThis)@cox.net> wrote:
>
>
>
>
>
> > This will need to be done using VBA.

>
> > Press Alt+F11 to enter the VB Editor.
> > On the left, you should see your workbook listed as
> > "VBAProject(YourWorkbook)". If there is a plus to the left of it, click
> > it
> > to make it a minus which expands the list as well. Do the same thing for
> > "Microsoft Excel Objects".
> > Double-click on ThisWorkbook.
> > Paste the following code in the right-hand pane.

>
> > Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
> > Range)
> > Stop
> > If ActiveSheet.Name = "Data" And Sheets(Target.Row).Name <> "Data" _
> > Then
> > If Target.Column = 1 And Target.Value <> "" Then
> > Sheets(Target.Row).Name = Target.Value
> > Else
> > End If
> > End Sub

>
> > HTH,
> > Paul

>
> > --

>
> > "wally" <ruwa...@att.net> wrote in message

>
> >news:567a2bea-a230-4168-b20c-(E-Mail Removed)...

>
> > >I have 16 sheets that are numbered 1 thru 16 on the tab. I also have a
> > > 17th sheet I have renamed "Data" (ignore quotes). I would like to type
> > > a name, (i.e., wonder) into cell a1 of the Data sheet and have that
> > > automatically change the name of sheet number 1 to "wonder". Then I
> > > would type another name (i.e., Hanger) into on the data sheet into
> > > cell a2 and that would change sheet number 2 to Hanger. I would
> > > continue to do this until all sheets are now changed to a name rather
> > > than a numer. Can this be accomplished by a formula?
> > > Thank you, Wally- Hide quoted text -

>
> > - Show quoted text -

>
> Hi Paul,
> Followed your instructions but when I type in a name in cell A1 on
> sheet Data, nothing happens. I go to VBA and the first line (Private
> Sub Workbook, etc) is highlighted in yellow.
> Wally- Hide quoted text -
>
> - Show quoted text -



 
Reply With Quote
 
wally
Guest
Posts: n/a
 
      26th Jun 2008
On Jun 26, 6:07*pm, "PCLIVE" <pclive(RemoveThis)@cox.net> wrote:
> If you're not getting an error, while you've got the VBA window open and you
> see the highlighted line, try pressing F5.
>
> --
>
> "wally" <ruwa...@att.net> wrote in message
>
> news:d1fd75d5-13ae-4721-b4ce-(E-Mail Removed)...
> I removed stop and the same thing happens.
>
> On Jun 26, 5:03 pm, "PCLIVE" <pclive(RemoveThis)@cox.net> wrote:
>
>
>
> > Oops. Sorry about that.
> > Remove "Stop" from the beginning of the code. That was there for testing
> > purposes.

>
> > --

>
> > "wally" <ruwa...@att.net> wrote in message

>
> >news:6acf8fcc-9641-476d-b6af-(E-Mail Removed)....
> > On Jun 26, 4:12 pm, "PCLIVE" <pclive(RemoveThis)@cox.net> wrote:

>
> > > This will need to be done using VBA.

>
> > > Press Alt+F11 to enter the VB Editor.
> > > On the left, you should see your workbook listed as
> > > "VBAProject(YourWorkbook)". If there is a plus to the left of it, click
> > > it
> > > to make it a minus which expands the list as well. Do the same thing for
> > > "Microsoft Excel Objects".
> > > Double-click on ThisWorkbook.
> > > Paste the following code in the right-hand pane.

>
> > > Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
> > > Range)
> > > Stop
> > > If ActiveSheet.Name = "Data" And Sheets(Target.Row).Name <> "Data" _
> > > Then
> > > If Target.Column = 1 And Target.Value <> "" Then
> > > Sheets(Target.Row).Name = Target.Value
> > > Else
> > > End If
> > > End Sub

>
> > > HTH,
> > > Paul

>
> > > --

>
> > > "wally" <ruwa...@att.net> wrote in message

>
> > >news:567a2bea-a230-4168-b20c-(E-Mail Removed)....

>
> > > >I have 16 sheets that are numbered 1 thru 16 on the tab. I also havea
> > > > 17th sheet I have renamed "Data" (ignore quotes). I would like to type
> > > > a name, (i.e., wonder) into cell a1 of the Data sheet and have that
> > > > automatically change the name of sheet number 1 to "wonder". Then I
> > > > would type another name (i.e., Hanger) into on the data sheet into
> > > > cell a2 and that would change sheet number 2 to Hanger. I would
> > > > continue to do this until all sheets are now changed to a name rather
> > > > than a numer. Can this be accomplished by a formula?
> > > > Thank you, Wally- Hide quoted text -

>
> > > - Show quoted text -

>
> > Hi Paul,
> > Followed your instructions but when I type in a name in cell A1 on
> > sheet Data, nothing happens. I go to VBA and the first line (Private
> > Sub Workbook, etc) is highlighted in yellow.
> > Wally- Hide quoted text -

>
> > - Show quoted text -- Hide quoted text -

>
> - Show quoted text -


I pressed f5, error message: "Compile Error Block If Without End If"
 
Reply With Quote
 
PCLIVE
Guest
Posts: n/a
 
      27th Jun 2008
This is the result of Wrap-around that occurred during posting. The If
Target.Column... line and the line after was originally on one line. Since
wrap-around occurred, it was separated onto two lines creating a block if
statement. To avoid this, I've re-done the code so that it is in block if
format which should correct the wrap-around issue.

Try this:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Stop
If ActiveSheet.Name = "Data" And Sheets(Target.Row).Name <> "Data" _
Then
If Target.Column = 1 And Target.Value <> "" _
Then
Sheets(Target.Row).Name = Target.Value
Else
End If
Else
End If
End Sub

Does that help?
Paul

--

"wally" <(E-Mail Removed)> wrote in message
news:a8282f5d-a7de-40e7-a6ec-(E-Mail Removed)...
On Jun 26, 6:07 pm, "PCLIVE" <pclive(RemoveThis)@cox.net> wrote:
> If you're not getting an error, while you've got the VBA window open and
> you
> see the highlighted line, try pressing F5.
>
> --
>
> "wally" <ruwa...@att.net> wrote in message
>
> news:d1fd75d5-13ae-4721-b4ce-(E-Mail Removed)...
> I removed stop and the same thing happens.
>
> On Jun 26, 5:03 pm, "PCLIVE" <pclive(RemoveThis)@cox.net> wrote:
>
>
>
> > Oops. Sorry about that.
> > Remove "Stop" from the beginning of the code. That was there for testing
> > purposes.

>
> > --

>
> > "wally" <ruwa...@att.net> wrote in message

>
> >news:6acf8fcc-9641-476d-b6af-(E-Mail Removed)...
> > On Jun 26, 4:12 pm, "PCLIVE" <pclive(RemoveThis)@cox.net> wrote:

>
> > > This will need to be done using VBA.

>
> > > Press Alt+F11 to enter the VB Editor.
> > > On the left, you should see your workbook listed as
> > > "VBAProject(YourWorkbook)". If there is a plus to the left of it,
> > > click
> > > it
> > > to make it a minus which expands the list as well. Do the same thing
> > > for
> > > "Microsoft Excel Objects".
> > > Double-click on ThisWorkbook.
> > > Paste the following code in the right-hand pane.

>
> > > Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
> > > Range)
> > > Stop
> > > If ActiveSheet.Name = "Data" And Sheets(Target.Row).Name <> "Data" _
> > > Then
> > > If Target.Column = 1 And Target.Value <> "" Then
> > > Sheets(Target.Row).Name = Target.Value
> > > Else
> > > End If
> > > End Sub

>
> > > HTH,
> > > Paul

>
> > > --

>
> > > "wally" <ruwa...@att.net> wrote in message

>
> > >news:567a2bea-a230-4168-b20c-(E-Mail Removed)...

>
> > > >I have 16 sheets that are numbered 1 thru 16 on the tab. I also have
> > > >a
> > > > 17th sheet I have renamed "Data" (ignore quotes). I would like to
> > > > type
> > > > a name, (i.e., wonder) into cell a1 of the Data sheet and have that
> > > > automatically change the name of sheet number 1 to "wonder". Then I
> > > > would type another name (i.e., Hanger) into on the data sheet into
> > > > cell a2 and that would change sheet number 2 to Hanger. I would
> > > > continue to do this until all sheets are now changed to a name
> > > > rather
> > > > than a numer. Can this be accomplished by a formula?
> > > > Thank you, Wally- Hide quoted text -

>
> > > - Show quoted text -

>
> > Hi Paul,
> > Followed your instructions but when I type in a name in cell A1 on
> > sheet Data, nothing happens. I go to VBA and the first line (Private
> > Sub Workbook, etc) is highlighted in yellow.
> > Wally- Hide quoted text -

>
> > - Show quoted text -- Hide quoted text -

>
> - Show quoted text -


I pressed f5, error message: "Compile Error Block If Without End If"


 
Reply With Quote
 
PCLIVE
Guest
Posts: n/a
 
      27th Jun 2008
This is the result of Wrap-around that occurred during posting. The If
Target.Column... line and the line after was originally on one line. Since
wrap-around occurred, it was separated onto two lines creating a block if
statement. To avoid this, I've re-done the code so that it is in block if
format which should correct the wrap-around issue.

Try this:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If ActiveSheet.Name = "Data" And Sheets(Target.Row).Name <> "Data" _
Then
If Target.Column = 1 And Target.Value <> "" _
Then
Sheets(Target.Row).Name = Target.Value
Else
End If
Else
End If
End Sub

Does that help?
Paul

--

"wally" <(E-Mail Removed)> wrote in message
news:a8282f5d-a7de-40e7-a6ec-(E-Mail Removed)...
On Jun 26, 6:07 pm, "PCLIVE" <pclive(RemoveThis)@cox.net> wrote:
> If you're not getting an error, while you've got the VBA window open and
> you
> see the highlighted line, try pressing F5.
>
> --
>
> "wally" <ruwa...@att.net> wrote in message
>
> news:d1fd75d5-13ae-4721-b4ce-(E-Mail Removed)...
> I removed stop and the same thing happens.
>
> On Jun 26, 5:03 pm, "PCLIVE" <pclive(RemoveThis)@cox.net> wrote:
>
>
>
> > Oops. Sorry about that.
> > Remove "Stop" from the beginning of the code. That was there for testing
> > purposes.

>
> > --

>
> > "wally" <ruwa...@att.net> wrote in message

>
> >news:6acf8fcc-9641-476d-b6af-(E-Mail Removed)...
> > On Jun 26, 4:12 pm, "PCLIVE" <pclive(RemoveThis)@cox.net> wrote:

>
> > > This will need to be done using VBA.

>
> > > Press Alt+F11 to enter the VB Editor.
> > > On the left, you should see your workbook listed as
> > > "VBAProject(YourWorkbook)". If there is a plus to the left of it,
> > > click
> > > it
> > > to make it a minus which expands the list as well. Do the same thing
> > > for
> > > "Microsoft Excel Objects".
> > > Double-click on ThisWorkbook.
> > > Paste the following code in the right-hand pane.

>
> > > Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
> > > Range)
> > > Stop
> > > If ActiveSheet.Name = "Data" And Sheets(Target.Row).Name <> "Data" _
> > > Then
> > > If Target.Column = 1 And Target.Value <> "" Then
> > > Sheets(Target.Row).Name = Target.Value
> > > Else
> > > End If
> > > End Sub

>
> > > HTH,
> > > Paul

>
> > > --

>
> > > "wally" <ruwa...@att.net> wrote in message

>
> > >news:567a2bea-a230-4168-b20c-(E-Mail Removed)...

>
> > > >I have 16 sheets that are numbered 1 thru 16 on the tab. I also have
> > > >a
> > > > 17th sheet I have renamed "Data" (ignore quotes). I would like to
> > > > type
> > > > a name, (i.e., wonder) into cell a1 of the Data sheet and have that
> > > > automatically change the name of sheet number 1 to "wonder". Then I
> > > > would type another name (i.e., Hanger) into on the data sheet into
> > > > cell a2 and that would change sheet number 2 to Hanger. I would
> > > > continue to do this until all sheets are now changed to a name
> > > > rather
> > > > than a numer. Can this be accomplished by a formula?
> > > > Thank you, Wally- Hide quoted text -

>
> > > - Show quoted text -

>
> > Hi Paul,
> > Followed your instructions but when I type in a name in cell A1 on
> > sheet Data, nothing happens. I go to VBA and the first line (Private
> > Sub Workbook, etc) is highlighted in yellow.
> > Wally- Hide quoted text -

>
> > - Show quoted text -- Hide quoted text -

>
> - Show quoted text -


I pressed f5, error message: "Compile Error Block If Without End If"



 
Reply With Quote
 
wally
Guest
Posts: n/a
 
      28th Jun 2008
On Jun 27, 9:34*am, "PCLIVE" <pclive(RemoveThis)@cox.net> wrote:
> This is the result of Wrap-around that occurred during posting. *The If
> Target.Column... line and the line after was originally on one line. *Since
> wrap-around occurred, it was separated onto two lines creating a block if
> statement. *To avoid this, I've re-done the code so that it is in blockif
> format which should correct the wrap-around issue.
>
> Try this:
>
> Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
> If ActiveSheet.Name = "Data" And Sheets(Target.Row).Name <> "Data" _
> * * Then
> * * * * If Target.Column = 1 And Target.Value <> "" _
> * * * * * * Then
> * * * * * * * * Sheets(Target.Row).Name = Target.Value
> * * * * * * Else
> * * * * End If
> * * Else
> End If
> End Sub
>
> Does that help?
> Paul
>
> --
>
> "wally" <ruwa...@att.net> wrote in message
>
> news:a8282f5d-a7de-40e7-a6ec-(E-Mail Removed)...
> On Jun 26, 6:07 pm, "PCLIVE" <pclive(RemoveThis)@cox.net> wrote:
>
>
>
>
>
> > If you're not getting an error, while you've got the VBA window open and
> > you
> > see the highlighted line, try pressing F5.

>
> > --

>
> > "wally" <ruwa...@att.net> wrote in message

>
> >news:d1fd75d5-13ae-4721-b4ce-(E-Mail Removed)...
> > I removed stop and the same thing happens.

>
> > On Jun 26, 5:03 pm, "PCLIVE" <pclive(RemoveThis)@cox.net> wrote:

>
> > > Oops. Sorry about that.
> > > Remove "Stop" from the beginning of the code. That was there for testing
> > > purposes.

>
> > > --

>
> > > "wally" <ruwa...@att.net> wrote in message

>
> > >news:6acf8fcc-9641-476d-b6af-(E-Mail Removed)....
> > > On Jun 26, 4:12 pm, "PCLIVE" <pclive(RemoveThis)@cox.net> wrote:

>
> > > > This will need to be done using VBA.

>
> > > > Press Alt+F11 to enter the VB Editor.
> > > > On the left, you should see your workbook listed as
> > > > "VBAProject(YourWorkbook)". If there is a plus to the left of it,
> > > > click
> > > > it
> > > > to make it a minus which expands the list as well. Do the same thing
> > > > for
> > > > "Microsoft Excel Objects".
> > > > Double-click on ThisWorkbook.
> > > > Paste the following code in the right-hand pane.

>
> > > > Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
> > > > Range)
> > > > Stop
> > > > If ActiveSheet.Name = "Data" And Sheets(Target.Row).Name <> "Data" _
> > > > Then
> > > > If Target.Column = 1 And Target.Value <> "" Then
> > > > Sheets(Target.Row).Name = Target.Value
> > > > Else
> > > > End If
> > > > End Sub

>
> > > > HTH,
> > > > Paul

>
> > > > --

>
> > > > "wally" <ruwa...@att.net> wrote in message

>
> > > >news:567a2bea-a230-4168-b20c-(E-Mail Removed)...

>
> > > > >I have 16 sheets that are numbered 1 thru 16 on the tab. I also have
> > > > >a
> > > > > 17th sheet I have renamed "Data" (ignore quotes). I would like to
> > > > > type
> > > > > a name, (i.e., wonder) into cell a1 of the Data sheet and have that
> > > > > automatically change the name of sheet number 1 to "wonder". ThenI
> > > > > would type another name (i.e., Hanger) into on the data sheet into
> > > > > cell a2 and that would change sheet number 2 to Hanger. I would
> > > > > continue to do this until all sheets are now changed to a name
> > > > > rather
> > > > > than a numer. Can this be accomplished by a formula?
> > > > > Thank you,Wally- Hide quoted text -

>
> > > > - Show quoted text -

>
> > > Hi Paul,
> > > Followed your instructions but when I type in a name in cell A1 on
> > > sheet Data, nothing happens. I go to VBA and the first line (Private
> > > Sub Workbook, etc) is highlighted in yellow.
> > >Wally- Hide quoted text -

>
> > > - Show quoted text -- Hide quoted text -

>
> > - Show quoted text -

>
> I pressed f5, error message: "Compile Error Block If Without End If"- Hide quoted text -
>
> - Show quoted text -


It works great!! Thanks a million Paul, just what I wanted.
Wally
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
automatically change the worksheet reference when new sheet added Joel Microsoft Excel Worksheet Functions 8 29th Nov 2008 01:01 AM
Can Tab name in worksheet change automatically by referencing a ce Alvyn Microsoft Excel Worksheet Functions 2 6th Aug 2008 04:17 PM
How do I change the source worksheet for 100 charts automatically. Excel Forecaster Microsoft Excel Charting 1 31st May 2008 01:05 PM
worksheet tabs automatically change? =?Utf-8?B?aG9uZXlnaXJsMTE5?= Microsoft Excel Worksheet Functions 1 30th Jan 2006 03:24 PM
How to automatically change the referenced worksheet name in all formulas? steven.cole@gmail.com Microsoft Excel Programming 2 17th May 2005 02:33 PM


Features
 

Advertising
 

Newsgroups
 


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