please help
how do i give a tab of a worksheet the same name as a cell in the worksheet,
automatically

RE: tab name by BarbReinhardt

BarbReinhardt
Thu May 08 10:11:01 CDT 2008

In Excel 2003, you'd need to use VBA. I'm guessing it's the same in Excel
2007. Is this the route you want to take?
--
HTH,
Barb Reinhardt



"des-sa" wrote:

> please help
> how do i give a tab of a worksheet the same name as a cell in the worksheet,
> automatically

Re: tab name by Rick

Rick
Thu May 08 10:14:36 CDT 2008

You will need to use worksheet event code to do that. Right-click the
worksheet's tab and select View Code from the popup menu that appears, then
copy/paste this code into the code window that appeared...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then ActiveSheet.Name = Target.Value
End Sub

Change the reference to "$A$1" to the absolute address of the cell you
actually want to use. Then, whenever you change the text in that cell, the
worksheet tab will be changed to whatever you typed into it.

Rick


"des-sa" <dessa@discussions.microsoft.com> wrote in message
news:CB87F1C1-9B5F-45BE-B278-58F7097657DD@microsoft.com...
> please help
> how do i give a tab of a worksheet the same name as a cell in the
> worksheet,
> automatically


RE: tab name by GarysStudent

GarysStudent
Thu May 08 10:17:01 CDT 2008

Say cell A1 is the cell in question. If A1 is filled by data entry, then use
this worksheet event macro:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set a1 = Range("A1")
If Intersect(t, a1) Is Nothing Then Exit Sub
ActiveSheet.Name = a1.Value
End Sub


If A1 is determine by a formula, then use this worksheet event macro:

Private Sub Worksheet_Calculate()
ActiveSheet.Name = Range("A1").Value
End Sub



Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm


--
Gary''s Student - gsnu200784


"des-sa" wrote:

> please help
> how do i give a tab of a worksheet the same name as a cell in the worksheet,
> automatically

RE: tab name by dessa

dessa
Thu May 08 10:23:03 CDT 2008

Hi,
i use excel 2003. to be honest, i have no idea what/how to do it. could you
please help. let me explain what i actually want to do, maybe you're in a
better position to advise then. i use a worksheet as a template for quotes i
give to clients - like 30 a day. so i want to reproduce the master /
template sheet everytime a new quote is given, than automatically number each
new quote - and then - name eithe the tab or new file the name of that
automatically generated quote number.
thank you immensely for your time!

"Barb Reinhardt" wrote:

> In Excel 2003, you'd need to use VBA. I'm guessing it's the same in Excel
> 2007. Is this the route you want to take?
> --
> HTH,
> Barb Reinhardt
>
>
>
> "des-sa" wrote:
>
> > please help
> > how do i give a tab of a worksheet the same name as a cell in the worksheet,
> > automatically

Re: tab name by dessa

dessa
Thu May 08 10:53:25 CDT 2008

done that, nothing happens?

"Rick Rothstein (MVP - VB)" wrote:

> You will need to use worksheet event code to do that. Right-click the
> worksheet's tab and select View Code from the popup menu that appears, then
> copy/paste this code into the code window that appeared...
>
> Private Sub Worksheet_Change(ByVal Target As Range)
> If Target.Address = "$A$1" Then ActiveSheet.Name = Target.Value
> End Sub
>
> Change the reference to "$A$1" to the absolute address of the cell you
> actually want to use. Then, whenever you change the text in that cell, the
> worksheet tab will be changed to whatever you typed into it.
>
> Rick
>
>
> "des-sa" <dessa@discussions.microsoft.com> wrote in message
> news:CB87F1C1-9B5F-45BE-B278-58F7097657DD@microsoft.com...
> > please help
> > how do i give a tab of a worksheet the same name as a cell in the
> > worksheet,
> > automatically
>
>

Re: tab name by dessa

dessa
Thu May 08 10:55:00 CDT 2008

got it!!!!!!!!!!!!
cant thank u enough!!
Disri

"Rick Rothstein (MVP - VB)" wrote:

> You will need to use worksheet event code to do that. Right-click the
> worksheet's tab and select View Code from the popup menu that appears, then
> copy/paste this code into the code window that appeared...
>
> Private Sub Worksheet_Change(ByVal Target As Range)
> If Target.Address = "$A$1" Then ActiveSheet.Name = Target.Value
> End Sub
>
> Change the reference to "$A$1" to the absolute address of the cell you
> actually want to use. Then, whenever you change the text in that cell, the
> worksheet tab will be changed to whatever you typed into it.
>
> Rick
>
>
> "des-sa" <dessa@discussions.microsoft.com> wrote in message
> news:CB87F1C1-9B5F-45BE-B278-58F7097657DD@microsoft.com...
> > please help
> > how do i give a tab of a worksheet the same name as a cell in the
> > worksheet,
> > automatically
>
>

Re: tab name by BarbReinhardt

BarbReinhardt
Thu May 08 10:57:00 CDT 2008

It will only work if you have macros enabled and if you change cell A1 on the
given worksheet. If you try to name a worksheet with a name that already
exists, it won't let you do it though.
--
HTH,
Barb Reinhardt



"des-sa" wrote:

> done that, nothing happens?
>
> "Rick Rothstein (MVP - VB)" wrote:
>
> > You will need to use worksheet event code to do that. Right-click the
> > worksheet's tab and select View Code from the popup menu that appears, then
> > copy/paste this code into the code window that appeared...
> >
> > Private Sub Worksheet_Change(ByVal Target As Range)
> > If Target.Address = "$A$1" Then ActiveSheet.Name = Target.Value
> > End Sub
> >
> > Change the reference to "$A$1" to the absolute address of the cell you
> > actually want to use. Then, whenever you change the text in that cell, the
> > worksheet tab will be changed to whatever you typed into it.
> >
> > Rick
> >
> >
> > "des-sa" <dessa@discussions.microsoft.com> wrote in message
> > news:CB87F1C1-9B5F-45BE-B278-58F7097657DD@microsoft.com...
> > > please help
> > > how do i give a tab of a worksheet the same name as a cell in the
> > > worksheet,
> > > automatically
> >
> >