Thread: Custom Header
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rowan Drummond[_3_] Rowan Drummond[_3_] is offline
external usenet poster
 
Posts: 414
Default Custom Header

This worked for me:

Private Sub Workbook_Open()
Dim i As Integer
For i = 1 To 3
With Sheets(i)
.PageSetup.RightHeader = Sheets("Sheet1").Range("B2").Value
End With
Next i
End Sub

Hope this helps
Rowan

ts1 wrote:
Jim,

I am still new to macro programming and tried using your suggestion in the
Workbook_open event with no luck. Can you please provide a some additional
guidance in the following scenario.

I have a workbook with 3 worksheets. There is a value in cell B2 of Sheet1
that I want the custom header of all three worksheets to have. Any help would
be much appreciated.

Thanks,
Tom S

"Jim Thomlinson" wrote:


Sub AddToHeader()
With Sheets("Sheet1")
.PageSetup.RightHeader = .Range("D1").Value
End With
End Sub
--
HTH...

Jim Thomlinson