ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   formatting headers (https://www.excelbanter.com/excel-programming/281506-formatting-headers.html)

need-A-hand

formatting headers
 
Hello,
I wonder if you can help me

I know how to format a string within a header

eg:
sheet1.pagesetup.centerheader="&""ariel,bold"&""&1 4HELLO"
formats the word HELLO to bold and size 14

However, instead of HELLO, I need to put in a variable
which represents a date.
If anyone can help I'd be very grateful

Many thanks
Geoff

Vasant Nanavati

formatting headers
 
Hi:

Try:

Sheet1.PageSetup.CenterHeader = "&""Arial""&14&B" & _
Format(Date, "d-mmm-yyyy")

Regards,

Vasant.

"need-A-hand" wrote in message
...
Hello,
I wonder if you can help me

I know how to format a string within a header

eg:
sheet1.pagesetup.centerheader="&""ariel,bold"&""&1 4HELLO"
formats the word HELLO to bold and size 14

However, instead of HELLO, I need to put in a variable
which represents a date.
If anyone can help I'd be very grateful

Many thanks
Geoff




Tom Ogilvy

formatting headers
 

This puts in a date with the format you specify, but it should be run before
each print:

With ActiveSheet.PageSetup
.LeftFooter = "&""Arial,Bold""&14" & Format(Date, "mmm dd, yyyy")
End With


this uses the special date character so the date it updated automatically
with the short date format:

With ActiveSheet.PageSetup
.LeftHeader = "&""Arial,Bold""&14&D"
End With

--
Regards,
Tom Ogilvy



need-A-hand wrote in message
...
Hello,
I wonder if you can help me

I know how to format a string within a header

eg:
sheet1.pagesetup.centerheader="&""ariel,bold"&""&1 4HELLO"
formats the word HELLO to bold and size 14

However, instead of HELLO, I need to put in a variable
which represents a date.
If anyone can help I'd be very grateful

Many thanks
Geoff





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

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