Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
i want to only show a part of the worksheet tab name in header. for e.g, I
have my worksheet named Annex I - Buildings but I want only Annex I to be displayed. How do I do that? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I'm not sure what you mean by 'in a header' but to display the 7 leftmost characters of your worksheet name try this =MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,7) Adjust the last number 7 to display more or less characters Mike "AsquareDC" wrote: i want to only show a part of the worksheet tab name in header. for e.g, I have my worksheet named Annex I - Buildings but I want only Annex I to be displayed. How do I do that? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
thanks for your response.
I wanted the name of my worksheet to be displayed in the header by using "&[Tab]". However I do not want all the name to be displayed and I was thinking that there is a syntax that could be used in the header section that allows for some of it to be truncated. That is what I am looking for. "Mike H" wrote: Hi, I'm not sure what you mean by 'in a header' but to display the 7 leftmost characters of your worksheet name try this =MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,7) Adjust the last number 7 to display more or less characters Mike "AsquareDC" wrote: i want to only show a part of the worksheet tab name in header. for e.g, I have my worksheet named Annex I - Buildings but I want only Annex I to be displayed. How do I do that? |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The correct function to get worksheet name is CELL, did you try it?
"AsquareDC" wrote: thanks for your response. I wanted the name of my worksheet to be displayed in the header by using "&[Tab]". However I do not want all the name to be displayed and I was thinking that there is a syntax that could be used in the header section that allows for some of it to be truncated. That is what I am looking for. "Mike H" wrote: Hi, I'm not sure what you mean by 'in a header' but to display the 7 leftmost characters of your worksheet name try this =MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,7) Adjust the last number 7 to display more or less characters Mike "AsquareDC" wrote: i want to only show a part of the worksheet tab name in header. for e.g, I have my worksheet named Annex I - Buildings but I want only Annex I to be displayed. How do I do that? |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You'd have to use a macro (or do it manually).
This kind of macro would go in the ThisWorkbook module: Option Explicit Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim myHeader As String With Me.Worksheets("Annex I - Buildings") myHeader = Mid(.Name, 1, Len(.Name) - Len("- buildings") - 1) .PageSetup.CenterHeader = myHeader End With End Sub AsquareDC wrote: thanks for your response. I wanted the name of my worksheet to be displayed in the header by using "&[Tab]". However I do not want all the name to be displayed and I was thinking that there is a syntax that could be used in the header section that allows for some of it to be truncated. That is what I am looking for. "Mike H" wrote: Hi, I'm not sure what you mean by 'in a header' but to display the 7 leftmost characters of your worksheet name try this =MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,7) Adjust the last number 7 to display more or less characters Mike "AsquareDC" wrote: i want to only show a part of the worksheet tab name in header. for e.g, I have my worksheet named Annex I - Buildings but I want only Annex I to be displayed. How do I do that? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Unable to Insert Worksheet/Move and copy worksheet Excel 2003 | Excel Worksheet Functions | |||
plot graph from multiple worksheet as embedded chart object on every worksheet | Charts and Charting in Excel | |||
plot graph from multiple worksheet as embedded chart object on every worksheet | Excel Discussion (Misc queries) | |||
plot graph from multiple worksheet as embedded chart object on every worksheet | Excel Worksheet Functions | |||
Upload multiple text files into 1 excel worksheet + put the filename as the first column in the worksheet | Excel Worksheet Functions |