#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 74
Default tab name

please help
how do i give a tab of a worksheet the same name as a cell in the worksheet,
automatically
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,355
Default tab name

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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default tab name

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" wrote in message
...
please help
how do i give a tab of a worksheet the same name as a cell in the
worksheet,
automatically


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default tab name

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

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 74
Default tab name

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



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 74
Default tab name

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" wrote in message
...
please help
how do i give a tab of a worksheet the same name as a cell in the
worksheet,
automatically



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 74
Default tab name

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" wrote in message
...
please help
how do i give a tab of a worksheet the same name as a cell in the
worksheet,
automatically



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,355
Default tab name

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" wrote in message
...
please help
how do i give a tab of a worksheet the same name as a cell in the
worksheet,
automatically



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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



All times are GMT +1. The time now is 09:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"