Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a workbook with 41 sheets. When printed out each sheet may be more
than one page. However, each sheet is a separate tab in a notebook. So I wonder if there's a way to set up a header in such a way that the sheet (i.e., tab) number prints. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
In A1 enter this formula it will give the tab name then you will use it in yours prints =MID(CELL("filename",C1),FIND("]",CELL("filename",C1))+1,255) "Steve" wrote: I have a workbook with 41 sheets. When printed out each sheet may be more than one page. However, each sheet is a separate tab in a notebook. So I wonder if there's a way to set up a header in such a way that the sheet (i.e., tab) number prints. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I don't want the sheet name. I want the sheet number...1, 2, 3, etc.
"Eduardo" wrote: Hi, In A1 enter this formula it will give the tab name then you will use it in yours prints =MID(CELL("filename",C1),FIND("]",CELL("filename",C1))+1,255) "Steve" wrote: I have a workbook with 41 sheets. When printed out each sheet may be more than one page. However, each sheet is a separate tab in a notebook. So I wonder if there's a way to set up a header in such a way that the sheet (i.e., tab) number prints. |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You want the codename/number of the sheet?
Sub sheetnumber() Dim ws As Worksheet For Each ws In ActiveWorkbook.Sheets ws.PageSetup.CenterFooter = ws.CodeName Next End Sub Gord Dibben MS Excel MVP On Mon, 8 Dec 2008 12:57:00 -0800, Steve wrote: I don't want the sheet name. I want the sheet number...1, 2, 3, etc. "Eduardo" wrote: Hi, In A1 enter this formula it will give the tab name then you will use it in yours prints =MID(CELL("filename",C1),FIND("]",CELL("filename",C1))+1,255) "Steve" wrote: I have a workbook with 41 sheets. When printed out each sheet may be more than one page. However, each sheet is a separate tab in a notebook. So I wonder if there's a way to set up a header in such a way that the sheet (i.e., tab) number prints. |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
That's what I thought I wanted. However, after I created all of the
worksheets I rearranged them. So the codenames aren't sequential. For example the first sheet in the workbook is actually sheet41. Maybe it's not possible to do what I want to do. Thanks for trying, though. "Gord Dibben" wrote: You want the codename/number of the sheet? Sub sheetnumber() Dim ws As Worksheet For Each ws In ActiveWorkbook.Sheets ws.PageSetup.CenterFooter = ws.CodeName Next End Sub Gord Dibben MS Excel MVP On Mon, 8 Dec 2008 12:57:00 -0800, Steve wrote: I don't want the sheet name. I want the sheet number...1, 2, 3, etc. "Eduardo" wrote: Hi, In A1 enter this formula it will give the tab name then you will use it in yours prints =MID(CELL("filename",C1),FIND("]",CELL("filename",C1))+1,255) "Steve" wrote: I have a workbook with 41 sheets. When printed out each sheet may be more than one page. However, each sheet is a separate tab in a notebook. So I wonder if there's a way to set up a header in such a way that the sheet (i.e., tab) number prints. |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You want the sheets' position numbers?
Sub sheetnumber() Dim I As Integer, J As Integer For I = 1 To Sheets.Count For J = I To Sheets.Count Sheets(J).PageSetup.CenterFooter = "sht " & I Next J Next I End Sub Gord On Mon, 8 Dec 2008 13:55:01 -0800, Steve wrote: That's what I thought I wanted. However, after I created all of the worksheets I rearranged them. So the codenames aren't sequential. For example the first sheet in the workbook is actually sheet41. Maybe it's not possible to do what I want to do. Thanks for trying, though. "Gord Dibben" wrote: You want the codename/number of the sheet? Sub sheetnumber() Dim ws As Worksheet For Each ws In ActiveWorkbook.Sheets ws.PageSetup.CenterFooter = ws.CodeName Next End Sub Gord Dibben MS Excel MVP On Mon, 8 Dec 2008 12:57:00 -0800, Steve wrote: I don't want the sheet name. I want the sheet number...1, 2, 3, etc. "Eduardo" wrote: Hi, In A1 enter this formula it will give the tab name then you will use it in yours prints =MID(CELL("filename",C1),FIND("]",CELL("filename",C1))+1,255) "Steve" wrote: I have a workbook with 41 sheets. When printed out each sheet may be more than one page. However, each sheet is a separate tab in a notebook. So I wonder if there's a way to set up a header in such a way that the sheet (i.e., tab) number prints. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Identify the row in which a MAX number in a column resides | Excel Worksheet Functions | |||
looking for formula to identify next non-empty cell on another sheet | Excel Worksheet Functions | |||
Identify number of items with characterisitics from two columns | Excel Worksheet Functions | |||
VBA code to identify last row in a sheet | Excel Discussion (Misc queries) | |||
Formula to Identify Column Number | Excel Discussion (Misc queries) |