ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Modifying a footer date (https://www.excelbanter.com/excel-discussion-misc-queries/51611-modifying-footer-date.html)

jim314

Modifying a footer date
 
First, just to clarify, I am NOT looking to print the date/time the file was
last modified, but rather I am looking to modify the default date format that
Excel displays on the footers. How can this be done?

Example:
Currently the date looks like this: 10/21/05
I would like the date to look like this: Friday, October 21, 2005

Thanks in advance,

Jim

Bob Phillips

Modifying a footer date
 
If you do use the print the date technique you can specify its format


Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.LeftFooter = Format(Date, "dddd, mmmm dd, yyyy")
End With
End Sub
'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--

HTH

RP
(remove nothere from the email address if mailing direct)


"jim314" wrote in message
...
First, just to clarify, I am NOT looking to print the date/time the file

was
last modified, but rather I am looking to modify the default date format

that
Excel displays on the footers. How can this be done?

Example:
Currently the date looks like this: 10/21/05
I would like the date to look like this: Friday, October 21, 2005

Thanks in advance,

Jim




Mary Sasiela

Modifying a footer date
 
Hello
I would like something similar. In the center footer (I've already modified
'Left" to "center' in the string), I need a line of text in the center footer
with the text "Last Printed 25-OCT-2005" (for example) on the second line of
the footer. So it would read in center footer:
Effective date - whatever text I type - not an updatable field
Last Printed &[Date]
(where the format must be dd-MMM-yyyy)

When I use Bob's string below, it's overwriting my first line of code.

My thx. in advance for your help.

Mary

"Bob Phillips" wrote:

If you do use the print the date technique you can specify its format


Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.LeftFooter = Format(Date, "dddd, mmmm dd, yyyy")
End With
End Sub
'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--

HTH

RP
(remove nothere from the email address if mailing direct)


"jim314" wrote in message
...
First, just to clarify, I am NOT looking to print the date/time the file

was
last modified, but rather I am looking to modify the default date format

that
Excel displays on the footers. How can this be done?

Example:
Currently the date looks like this: 10/21/05
I would like the date to look like this: Friday, October 21, 2005

Thanks in advance,

Jim





Bob Phillips

Modifying a footer date
 
Mary,

Try this

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim sTemp As String
Dim iPos As Long
With ActiveSheet.PageSetup
sTemp = .LeftFooter
iPos = InStr(sTemp, "Last Printed:")
If iPos 0 Then
sTemp = Left(sTemp, iPos - 1)
End If
.LeftFooter = sTemp & vbNewLine & _
"Last Printed: " & Format(Date, "dd-mmm-yyyy")
End With
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mary Sasiela" wrote in message
...
Hello
I would like something similar. In the center footer (I've already

modified
'Left" to "center' in the string), I need a line of text in the center

footer
with the text "Last Printed 25-OCT-2005" (for example) on the second line

of
the footer. So it would read in center footer:
Effective date - whatever text I type - not an updatable field
Last Printed &[Date]
(where the format must be dd-MMM-yyyy)

When I use Bob's string below, it's overwriting my first line of code.

My thx. in advance for your help.

Mary

"Bob Phillips" wrote:

If you do use the print the date technique you can specify its format


Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.LeftFooter = Format(Date, "dddd, mmmm dd, yyyy")
End With
End Sub
'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--

HTH

RP
(remove nothere from the email address if mailing direct)


"jim314" wrote in message
...
First, just to clarify, I am NOT looking to print the date/time the

file
was
last modified, but rather I am looking to modify the default date

format
that
Excel displays on the footers. How can this be done?

Example:
Currently the date looks like this: 10/21/05
I would like the date to look like this: Friday, October 21, 2005

Thanks in advance,

Jim







Mary Sasiela

Modifying a footer date
 
Many thanks Bob. I'll try tonight & let you know. THX for your quick
response!

Mary

"Bob Phillips" wrote:

Mary,

Try this

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim sTemp As String
Dim iPos As Long
With ActiveSheet.PageSetup
sTemp = .LeftFooter
iPos = InStr(sTemp, "Last Printed:")
If iPos 0 Then
sTemp = Left(sTemp, iPos - 1)
End If
.LeftFooter = sTemp & vbNewLine & _
"Last Printed: " & Format(Date, "dd-mmm-yyyy")
End With
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mary Sasiela" wrote in message
...
Hello
I would like something similar. In the center footer (I've already

modified
'Left" to "center' in the string), I need a line of text in the center

footer
with the text "Last Printed 25-OCT-2005" (for example) on the second line

of
the footer. So it would read in center footer:
Effective date - whatever text I type - not an updatable field
Last Printed &[Date]
(where the format must be dd-MMM-yyyy)

When I use Bob's string below, it's overwriting my first line of code.

My thx. in advance for your help.

Mary

"Bob Phillips" wrote:

If you do use the print the date technique you can specify its format


Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.LeftFooter = Format(Date, "dddd, mmmm dd, yyyy")
End With
End Sub
'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--

HTH

RP
(remove nothere from the email address if mailing direct)


"jim314" wrote in message
...
First, just to clarify, I am NOT looking to print the date/time the

file
was
last modified, but rather I am looking to modify the default date

format
that
Excel displays on the footers. How can this be done?

Example:
Currently the date looks like this: 10/21/05
I would like the date to look like this: Friday, October 21, 2005

Thanks in advance,

Jim







Mary Sasiela

Modifying a footer date
 
Hi again

So ... I think I'm close. I modified the code to be CenterFooter - that's
fine.

But I'm getting an extra linefeed that I don't want. What I do want in the
centre footer is:

Effective Date - (a date manually entered by me - fot a field)
Last Printed: (then, last printed date)

There should only be one line feed after Effective date.

I cut out the "& vbNewLine" but it's still doing it.

Any advice?

Mary

"Bob Phillips" wrote:

Mary,

Try this

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim sTemp As String
Dim iPos As Long
With ActiveSheet.PageSetup
sTemp = .LeftFooter
iPos = InStr(sTemp, "Last Printed:")
If iPos 0 Then
sTemp = Left(sTemp, iPos - 1)
End If
.LeftFooter = sTemp & vbNewLine & _
"Last Printed: " & Format(Date, "dd-mmm-yyyy")
End With
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mary Sasiela" wrote in message
...
Hello
I would like something similar. In the center footer (I've already

modified
'Left" to "center' in the string), I need a line of text in the center

footer
with the text "Last Printed 25-OCT-2005" (for example) on the second line

of
the footer. So it would read in center footer:
Effective date - whatever text I type - not an updatable field
Last Printed &[Date]
(where the format must be dd-MMM-yyyy)

When I use Bob's string below, it's overwriting my first line of code.

My thx. in advance for your help.

Mary

"Bob Phillips" wrote:

If you do use the print the date technique you can specify its format


Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.LeftFooter = Format(Date, "dddd, mmmm dd, yyyy")
End With
End Sub
'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--

HTH

RP
(remove nothere from the email address if mailing direct)


"jim314" wrote in message
...
First, just to clarify, I am NOT looking to print the date/time the

file
was
last modified, but rather I am looking to modify the default date

format
that
Excel displays on the footers. How can this be done?

Example:
Currently the date looks like this: 10/21/05
I would like the date to look like this: Friday, October 21, 2005

Thanks in advance,

Jim








All times are GMT +1. The time now is 05:56 AM.

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