ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   header formatting (https://www.excelbanter.com/excel-programming/348138-re-header-formatting.html)

quartz[_2_]

header formatting
 
Mike,

Try replacing "ActiveWorkbook.Name" with "&F" that may work...

HTH

"Mike" wrote:

I create a header in a work book using

With ActiveSheet.PageSetup
.RightHeader = "&B" & ActiveWorkbook.Name & "&B" & Chr(13) & "&A" &
Chr(13) & "&D" & Chr(13) & "Page &P of &N"
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
ActiveWindow.Zoom = 75
End With

This macro is in file xxx. When the user runs this macro and saves the file
to yyy.xls. I want the first line of the header to be yyy.xls. Currently if
the user runs the macro and saves the file to a different name. The header
is xxx.xls.

What am I missing?
Thanks for any help
Mike



All times are GMT +1. The time now is 02:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com