Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi! I have a worksheet where I need the Header to change based on a cell
value(V4)... Is this possible? I have worked through several VBA's but they dont seem to do the trick. Thanks for any help! |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I've done this with Workbook_BeforePrint Macro. Put this in the ThisWorkbook
Module. Sub Workbook_BeforePrint(Cancel As Boolean) 'The headers are updated to include the program name and the last save time 'each time the workbook is printed Application.ScreenUpdating = False With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = ActiveSheet.Range("V4").text .RightHeader = "" .LeftFooter = "" .CenterFooter = "" .RightFooter = "" .CenterHorizontally = True .CenterVertically = False End With Application.ScreenUpdating = True End Sub -- HTH, Barb Reinhardt If this post was helpful to you, please click YES below. "JAbels001" wrote: Hi! I have a worksheet where I need the Header to change based on a cell value(V4)... Is this possible? I have worked through several VBA's but they dont seem to do the trick. Thanks for any help! |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
Add this one line to a BeforePrint macro ActiveSheet.PageSetup.LeftHeader = [V4] -- If this helps, please click the Yes button Cheers, Shane Devenshire "JAbels001" wrote: Hi! I have a worksheet where I need the Header to change based on a cell value(V4)... Is this possible? I have worked through several VBA's but they dont seem to do the trick. Thanks for any help! |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
That VBA isnt working for me. Is it possible that I setup it up wrong? It's
placed on the tab I need to print as General... Is there anything else? "Barb Reinhardt" wrote: I've done this with Workbook_BeforePrint Macro. Put this in the ThisWorkbook Module. Sub Workbook_BeforePrint(Cancel As Boolean) 'The headers are updated to include the program name and the last save time 'each time the workbook is printed Application.ScreenUpdating = False With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = ActiveSheet.Range("V4").text .RightHeader = "" .LeftFooter = "" .CenterFooter = "" .RightFooter = "" .CenterHorizontally = True .CenterVertically = False End With Application.ScreenUpdating = True End Sub -- HTH, Barb Reinhardt If this post was helpful to you, please click YES below. "JAbels001" wrote: Hi! I have a worksheet where I need the Header to change based on a cell value(V4)... Is this possible? I have worked through several VBA's but they dont seem to do the trick. Thanks for any help! |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I got it to work! Thanks!
"Shane Devenshire" wrote: Hi, Add this one line to a BeforePrint macro ActiveSheet.PageSetup.LeftHeader = [V4] -- If this helps, please click the Yes button Cheers, Shane Devenshire "JAbels001" wrote: Hi! I have a worksheet where I need the Header to change based on a cell value(V4)... Is this possible? I have worked through several VBA's but they dont seem to do the trick. Thanks for any help! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Omit header from first page without embedding header in code | Excel Worksheet Functions | |||
Excel-Header-My Company Name won't work in Header (AT&T) & Time | Excel Discussion (Misc queries) | |||
Help with copying dynamic column selected based on remote cell value and dynamic formula fill | Charts and Charting in Excel | |||
Dynamic Range with unused formula messing up x axis on dynamic graph | Charts and Charting in Excel | |||
how do I permanetly add custom header to excel header list? | Excel Discussion (Misc queries) |