Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Format date in footer to propercase?

Hi,
I am trying to format the date inserted in the footer with &[Date].
I've searched the excel-groups, and it is my understanding that the
only way is through VBA.

This is what i have that works:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = Format(Date, "dd-mmm-yy")
End Sub

However i want to format the month so that dec becomes Dec. I know that
this is the standard for US settings, but i use Danish regional
settings and would rather not change these.

I have tried this:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = StrConv(Format(Date, "dd-mmm-yy"),
vbProperCase)
End Sub

But it does'nt work.
Any suggestions would be greatly appreciated.
thx
Thomas

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Format date in footer to propercase?

Hi
for me
Format(Date, "dd-mmm-yy")
does return '15-Dec-2004'

But you may try the following
ActiveSheet.PageSetup.RightFooter = Format(date,"dd") & "-" &
StrConv(Format(Date, "mmm"), vbProperCase) & _
"-" & format(date,"yy")


--
Regards
Frank Kabel
Frankfurt, Germany

Thomas wrote:
Hi,
I am trying to format the date inserted in the footer with &[Date].
I've searched the excel-groups, and it is my understanding that the
only way is through VBA.

This is what i have that works:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = Format(Date, "dd-mmm-yy")
End Sub

However i want to format the month so that dec becomes Dec. I know
that this is the standard for US settings, but i use Danish regional
settings and would rather not change these.

I have tried this:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = StrConv(Format(Date, "dd-mmm-yy"),
vbProperCase)
End Sub

But it does'nt work.
Any suggestions would be greatly appreciated.
thx
Thomas



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Format date in footer to propercase?

Hi Frank,

Thx a lot. It works.

This was a very fast answer. (Great) But i can not see my own question
(Im using google groups beta). I can only see your answer (which
offcause is most important). Can i ask what u use to read/answer the
group?

Thx again
Thomas

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Format date in footer to propercase?

Hi
I use Outlook Express. See:
http://www.mvps.org/dmcritchie/ie/oe6.htm

--
Regards
Frank Kabel
Frankfurt, Germany

Thomas wrote:
Hi Frank,

Thx a lot. It works.

This was a very fast answer. (Great) But i can not see my own question
(Im using google groups beta). I can only see your answer (which
offcause is most important). Can i ask what u use to read/answer the
group?

Thx again
Thomas



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Format date in footer to propercase?

? Format(Date, "dd-") & strConv(Format(Date,"mmm-yy"),vbProperCase)
15-Dec-04

--
Regards,
Tom Ogilvy


"Thomas" wrote in message
oups.com...
Hi,
I am trying to format the date inserted in the footer with &[Date].
I've searched the excel-groups, and it is my understanding that the
only way is through VBA.

This is what i have that works:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = Format(Date, "dd-mmm-yy")
End Sub

However i want to format the month so that dec becomes Dec. I know that
this is the standard for US settings, but i use Danish regional
settings and would rather not change these.

I have tried this:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = StrConv(Format(Date, "dd-mmm-yy"),
vbProperCase)
End Sub

But it does'nt work.
Any suggestions would be greatly appreciated.
thx
Thomas





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Format date in footer to propercase?

Hi Tom,

thx for your slightly shorter version :o)

Thomas

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Format date in footer to propercase?

Hi,

I have a supplementing question:
Thanks to your help i now have the date appearing as wanted, but i
would also like to change the font and fontsize of the date. I found
out that the second line below changes the font/size, but unfortunately
the two lines overrule each other. So i want to combine them into one
line somehow. I have tried all kinds of syntaxes but without succes.
Can anyone help?

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = Format(Date, "dd-") &
StrConv(Format(Date, "mmm-yy"), vbProperCase)
ActiveSheet.PageSetup.RightFooter = "&""Verdana""&8 "
End Sub

Thx again
Thomas

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Format date in footer to propercase?

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = "&""Verdana""&8 " & _
Format(Date, "dd-") & _
StrConv(Format(Date, "mmm-yy"), vbProperCase)
End Sub

--
Regards,
Tom Ogilvy




"Thomas" wrote in message
oups.com...
Hi,

I have a supplementing question:
Thanks to your help i now have the date appearing as wanted, but i
would also like to change the font and fontsize of the date. I found
out that the second line below changes the font/size, but unfortunately
the two lines overrule each other. So i want to combine them into one
line somehow. I have tried all kinds of syntaxes but without succes.
Can anyone help?

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = Format(Date, "dd-") &
StrConv(Format(Date, "mmm-yy"), vbProperCase)
ActiveSheet.PageSetup.RightFooter = "&""Verdana""&8 "
End Sub

Thx again
Thomas



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Format date in footer to propercase?

So all i needed was to combine the two expressions with an "&".
Kindda obvious - when you know it.
Thx for showing me the way ;o)
Thomas

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Footer date format Rita Brasher[_2_] Excel Discussion (Misc queries) 2 April 14th 10 11:12 PM
Custom footer date format Trekman03 Excel Discussion (Misc queries) 2 September 4th 09 07:30 PM
Header/Footer Date Format David Excel Worksheet Functions 2 March 12th 09 08:50 AM
Footer date format Imran Excel Discussion (Misc queries) 1 October 4th 05 01:18 PM
How do I format the date in a footer? RBono Excel Discussion (Misc queries) 1 February 10th 05 01:01 AM


All times are GMT +1. The time now is 12:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"