Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Is it possible to use VBA code to scroll through the sheets in a workbook and
if there's a center footer, add a CRLF and then some text. If there is not footer, just add the text. I use code to set footers but when I do something like this: Dim Sh As Worksheet For Each Sh In Worksheets With Sh.PageSetup .CenterFooter = "Some text" & Chr(10) & "Some more text" ... I get the footers replaced. I want it added to what's already there. Thanks. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
If I read your post correctly, this code should do it. If a footer
exists already, then this code adds to it. Note this Usenet interface word wraps, so you may need to revise the line breaks. Sub Append_Footer() Dim Sh As Worksheet For Each Sh In Sheets With Sh.PageSetup If .CenterFooter < "" Then .CenterFooter = .CenterFooter & " " & Chr(10) & "Some more text" End With Next Sh End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF formula in Excel / Replace numbers with 'words' | Excel Discussion (Misc queries) | |||
Excel: Add replace within selection functionality | Excel Discussion (Misc queries) | |||
Custom Footer for each page | Excel Worksheet Functions | |||
Search and replace | Excel Worksheet Functions | |||
replace absolute references | Excel Worksheet Functions |