Thread: Dynamic Header
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default Dynamic Header

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!