PC Review


Reply
Thread Tools Rate Thread

How can I label a worksheet based on a cell in Excel?

 
 
=?Utf-8?B?a2hhcnRsaW5l?=
Guest
Posts: n/a
 
      24th Feb 2006
I have a workbook with multiple worksheets and would like to know if there is
a way to label each worksheet based on info in cells on the first worksheet
of the workbook.

Don't know if this is even possible. The labels for the worksheets would be
text, not numbers or dates. Anyone know the answer to this one?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      25th Feb 2006
Here is a three sheet example. I am assuming that the first sheet has the
list of tab names in column A:


Sub Macro1()
' gsnu
Sheets(1).Name = Sheets(1).Cells(1, 1).Value
Sheets(2).Name = Sheets(1).Cells(2, 1).Value
Sheets(3).Name = Sheets(1).Cells(3, 1).Value
End Sub



--
Gary's Student


"khartline" wrote:

> I have a workbook with multiple worksheets and would like to know if there is
> a way to label each worksheet based on info in cells on the first worksheet
> of the workbook.
>
> Don't know if this is even possible. The labels for the worksheets would be
> text, not numbers or dates. Anyone know the answer to this one?

 
Reply With Quote
 
=?Utf-8?B?a2hhcnRsaW5l?=
Guest
Posts: n/a
 
      25th Feb 2006
Gary,

Thanks for the info. Can you tell me where to enter the macro code so this
will happen? Names are in column A, starting with line 11. How will that
change the code you posted.

Thanks for the reply. This is super helpful!
Karen

"Gary''s Student" wrote:

> Here is a three sheet example. I am assuming that the first sheet has the
> list of tab names in column A:
>
>
> Sub Macro1()
> ' gsnu
> Sheets(1).Name = Sheets(1).Cells(1, 1).Value
> Sheets(2).Name = Sheets(1).Cells(2, 1).Value
> Sheets(3).Name = Sheets(1).Cells(3, 1).Value
> End Sub
>
>
>
> --
> Gary's Student
>
>
> "khartline" wrote:
>
> > I have a workbook with multiple worksheets and would like to know if there is
> > a way to label each worksheet based on info in cells on the first worksheet
> > of the workbook.
> >
> > Don't know if this is even possible. The labels for the worksheets would be
> > text, not numbers or dates. Anyone know the answer to this one?

 
Reply With Quote
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      25th Feb 2006
If the data starts at l;ine 11 rather than lin 1 then:


Sub Macro1()
' gsnu
Sheets(1).Name = Sheets(1).Cells(11, 1).Value
Sheets(2).Name = Sheets(1).Cells(12, 1).Value
Sheets(3).Name = Sheets(1).Cells(13, 1).Value
End Sub

Put it in a module. For further instructions see:


http://www.cpearson.com/excel/vbe.htm
--
Gary''s Student


"khartline" wrote:

> Gary,
>
> Thanks for the info. Can you tell me where to enter the macro code so this
> will happen? Names are in column A, starting with line 11. How will that
> change the code you posted.
>
> Thanks for the reply. This is super helpful!
> Karen
>
> "Gary''s Student" wrote:
>
> > Here is a three sheet example. I am assuming that the first sheet has the
> > list of tab names in column A:
> >
> >
> > Sub Macro1()
> > ' gsnu
> > Sheets(1).Name = Sheets(1).Cells(1, 1).Value
> > Sheets(2).Name = Sheets(1).Cells(2, 1).Value
> > Sheets(3).Name = Sheets(1).Cells(3, 1).Value
> > End Sub
> >
> >
> >
> > --
> > Gary's Student
> >
> >
> > "khartline" wrote:
> >
> > > I have a workbook with multiple worksheets and would like to know if there is
> > > a way to label each worksheet based on info in cells on the first worksheet
> > > of the workbook.
> > >
> > > Don't know if this is even possible. The labels for the worksheets would be
> > > text, not numbers or dates. Anyone know the answer to this one?

 
Reply With Quote
 
=?Utf-8?B?S2FyZW4=?=
Guest
Posts: n/a
 
      15th Mar 2006
This is great and for the most part, is working. One more question...

It looks like when I enter the code below and have it listed for the 65
worksheets in the book, if not all 65 cells are filled in it gives me an
error message in Microsoft Visual basic of "400".

Two questions:
Is there a way to include an IF statement so if all 65 cells do not have
data in them, it's ok?

Is there a way to have this auto input the cell data into the tab or will I
have to go to TOOLS, MACROS, RUN each time I want the data to show up?

Thanks for your help!

"Gary''s Student" wrote:

> If the data starts at l;ine 11 rather than lin 1 then:
>
>
> Sub Macro1()
> ' gsnu
> Sheets(1).Name = Sheets(1).Cells(11, 1).Value
> Sheets(2).Name = Sheets(1).Cells(12, 1).Value
> Sheets(3).Name = Sheets(1).Cells(13, 1).Value
> End Sub
>
> Put it in a module. For further instructions see:
>
>
> http://www.cpearson.com/excel/vbe.htm
> --
> Gary''s Student
>
>
> "khartline" wrote:
>
> > Gary,
> >
> > Thanks for the info. Can you tell me where to enter the macro code so this
> > will happen? Names are in column A, starting with line 11. How will that
> > change the code you posted.
> >
> > Thanks for the reply. This is super helpful!
> > Karen
> >
> > "Gary''s Student" wrote:
> >
> > > Here is a three sheet example. I am assuming that the first sheet has the
> > > list of tab names in column A:
> > >
> > >
> > > Sub Macro1()
> > > ' gsnu
> > > Sheets(1).Name = Sheets(1).Cells(1, 1).Value
> > > Sheets(2).Name = Sheets(1).Cells(2, 1).Value
> > > Sheets(3).Name = Sheets(1).Cells(3, 1).Value
> > > End Sub
> > >
> > >
> > >
> > > --
> > > Gary's Student
> > >
> > >
> > > "khartline" wrote:
> > >
> > > > I have a workbook with multiple worksheets and would like to know if there is
> > > > a way to label each worksheet based on info in cells on the first worksheet
> > > > of the workbook.
> > > >
> > > > Don't know if this is even possible. The labels for the worksheets would be
> > > > text, not numbers or dates. Anyone know the answer to this one?

 
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
Changing name of worksheet based on data in cell of another worksheet bss5974@yahoo.com Microsoft Excel Programming 14 21st Apr 2011 10:04 PM
worksheet label in a cell Gecko Microsoft Excel Misc 4 8th Oct 2009 05:36 PM
change current cell colour based on the value of adjacent cell on other worksheet Rits Microsoft Excel Programming 2 23rd Nov 2006 11:57 AM
lookup column label based on data in cell =?Utf-8?B?QWFyb24=?= Microsoft Excel Worksheet Functions 2 22nd Aug 2006 04:13 PM
lookup column label based on data in cell =?Utf-8?B?QWFyb24=?= Microsoft Excel Worksheet Functions 0 22nd Aug 2006 03:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:55 PM.