Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
See the headings as I work down the page | Excel Discussion (Misc queries) | |||
REPEAT ROW HEADINGS ON EACH PAGE | Excel Discussion (Misc queries) | |||
print headings at the top of each page | Excel Discussion (Misc queries) | |||
Keeping column headings on top of page | Setting up and Configuration of Excel | |||
Keep Headings for Each Page | Excel Discussion (Misc queries) |