Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
khartline
 
Posts: n/a
Default How can I label a worksheet based on a cell in Excel?

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?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student
 
Posts: n/a
Default How can I label a worksheet based on a cell in Excel?

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?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
khartline
 
Posts: n/a
Default How can I label a worksheet based on a cell in Excel?

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?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student
 
Posts: n/a
Default How can I label a worksheet based on a cell in Excel?

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?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Karen
 
Posts: n/a
Default How can I label a worksheet based on a cell in Excel?

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
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I execute a macro based on the value of a cell in Excel? brettopp Excel Discussion (Misc queries) 12 June 17th 06 01:27 AM
Select cell from range based on input in excel xp dingy101 Excel Discussion (Misc queries) 3 November 20th 05 12:05 AM
how do i name a excel worksheet and make it appear in cell a1 tthe Excel Worksheet Functions 2 November 16th 05 04:14 AM
update cell in other worksheet based... mwrfsu Excel Worksheet Functions 0 August 19th 05 05:22 PM
Can I select a worksheet based upon a cell criteria?(for printing) Tim Richards Excel Worksheet Functions 0 March 30th 05 07:03 PM


All times are GMT +1. The time now is 09:14 AM.

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

About Us

"It's about Microsoft Excel"