Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Page Headings

I have several worksheets in my workbook. I am trying to take a value in one
of the sheets and place it in then center part of the heading in ALL the
worksheets. I have ttrued the following macro, but it doesnt seem to work

strAcctName = Sheet2.Range("G16")
For i = 1 To Sheets.Count
Sheets(i).Select
With ActiveSheet.PageSetup
.CenterHeader = "&""Arial,Italic""Account Name: &""Arial,Bold" &
strAcctName
End With
Next i


Any help would be appreciated.
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Page Headings

hi,
it works if you change it to this
Sub Macro2()

'im strAcctName As Range
Dim i As Integer

'Set strAcctName = Sheet2.Range("G16")
For i = 1 To Sheets.Count
Sheets(i).Select
'With ActiveSheet.PageSetup
' .CenterHeader = ""
'End With
With ActiveSheet.PageSetup
.CenterHeader = "&""Arial,Italic""Account Name:
&""Arial,Bold"" Doda"
' .CenterHeader = Range("G16")
End With
Next i

End Sub
get rid of strAcctName and just put the Acct name in
the .centerheader part. i used acct name doda.
-----Original Message-----
I have several worksheets in my workbook. I am trying to

take a value in one
of the sheets and place it in then center part of the

heading in ALL the
worksheets. I have ttrued the following macro, but it

doesnt seem to work

strAcctName = Sheet2.Range("G16")
For i = 1 To Sheets.Count
Sheets(i).Select
With ActiveSheet.PageSetup
.CenterHeader = "&""Arial,Italic""Account

Name: &""Arial,Bold" &
strAcctName
End With
Next i


Any help would be appreciated.
Thanks
.

Reply
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
See the headings as I work down the page Bold Grandmother Excel Discussion (Misc queries) 3 June 23rd 09 06:05 PM
REPEAT ROW HEADINGS ON EACH PAGE Jonathan Zingales Excel Discussion (Misc queries) 1 September 25th 08 12:05 PM
print headings at the top of each page onemanhattanrebel Excel Discussion (Misc queries) 1 September 25th 05 01:52 AM
Keeping column headings on top of page Martin Setting up and Configuration of Excel 1 July 27th 05 11:21 AM
Keep Headings for Each Page Charles Excel Discussion (Misc queries) 1 December 1st 04 11:46 PM


All times are GMT +1. The time now is 02:14 AM.

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

About Us

"It's about Microsoft Excel"