LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default More help on setting print headers via code

Hi!!
I'm using the code below to set the headers on all worksheets in the
workbook that have the name Adjustments in it.
I need to change this code to set this same header (as below) to all
worksheets in the active workbook except for any worksheets with the name
"Acct Info"
(There could be Acct Info (2), Acct Info (3) and so on...)
I'm not sure how to do this ....

Sub PrintHEADERAdjustment()
'Set Print Header on Adjusmtents sheets

Dim sh1 As Excel.Worksheet
Dim sh As Excel.Worksheet
Set sh1 = ActiveWorkbook.ActiveSheet
For Each sh In ActiveWorkbook.Worksheets
sh.Activate
If InStr(1, sh.Name, "Adjustments", vbTextCompare) Then
sh.PageSetup.CenterHeader = "&""Arial,Bold""&11" & "Insurance Co: "
& Range("Insurance_Co").Value & " " & "Policyholder: " &
Range("Policyholder").Value & Chr(10) & "Policy No: " &
Range("Policy_No").Value & Chr(10) & "Policy Period " & Range("From").Value
& " " & Range("To").Value

End If
Next 'sh

sh1.Activate
Set sh1 = Nothing
Set sh = Nothing

End Sub

As always.. Thanks in advance for your help,
Kimberly


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up Default Headers/Footers in Excel Dragon Lady Excel Discussion (Misc queries) 3 September 1st 09 07:57 PM
setting up common headers Vic Baron New Users to Excel 3 August 17th 09 09:07 PM
Setting more parameters with Print area code KimberlyC Excel Programming 10 July 8th 05 04:47 PM
Setting sheet names as headers with page numbering KimberlyC Excel Programming 3 May 12th 05 03:48 PM


All times are GMT +1. The time now is 06:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"