B
Brock
Hi:
I'm trying to update all the worksheet headers in a big SS at once via
VBA. I want to pull a value (a name) from a cell and have it update
the worksheet headers but I'm having problems with the following
argument:
..CenterHeader = "&""Microsoft Sans Serif,Regular""&14" &
..Range("name").Value
The entire command is as follows:
Sub InsertHeaderFooter()
' inserts the same header/footer in all worksheets
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
Application.StatusBar = "Changing header/footer in " & ws.Name
With ws.PageSetup
.LeftHeader = "&""Microsoft Sans Serif,Regular""&14" &
"Test Header"
.CenterHeader = "&""Microsoft Sans Serif,Regular""&14" &
..Range("name").Value
.RightHeader = "&""Microsoft Sans Serif,Regular""&14" &
"&D"
.CenterFooter = "&""Microsoft Sans Serif,Regular""&10" &
"Page &"
End With
Next ws
Set ws = Nothing
Application.StatusBar = False
End Sub
I've also tried:
..CenterHeader = "&""Microsoft Sans Serif,Regular""&14" & "f13" where
f13 is the cell with the name listed in it).
Any help would be appreciated.
I'm trying to update all the worksheet headers in a big SS at once via
VBA. I want to pull a value (a name) from a cell and have it update
the worksheet headers but I'm having problems with the following
argument:
..CenterHeader = "&""Microsoft Sans Serif,Regular""&14" &
..Range("name").Value
The entire command is as follows:
Sub InsertHeaderFooter()
' inserts the same header/footer in all worksheets
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
Application.StatusBar = "Changing header/footer in " & ws.Name
With ws.PageSetup
.LeftHeader = "&""Microsoft Sans Serif,Regular""&14" &
"Test Header"
.CenterHeader = "&""Microsoft Sans Serif,Regular""&14" &
..Range("name").Value
.RightHeader = "&""Microsoft Sans Serif,Regular""&14" &
"&D"
.CenterFooter = "&""Microsoft Sans Serif,Regular""&10" &
"Page &"
End With
Next ws
Set ws = Nothing
Application.StatusBar = False
End Sub
I've also tried:
..CenterHeader = "&""Microsoft Sans Serif,Regular""&14" & "f13" where
f13 is the cell with the name listed in it).
Any help would be appreciated.