Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Format dates in VB

How would I add a format to the current date in this bit of code. I want
dd/mm/yyyy:

ActiveSheet.PageSetup.CenterFooter = Date

Mervyn


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Format dates in VB

Mervyn,

Try this...
ActiveSheet.PageSetup.CenterFooter = Format$(Date, "dd/mm/yyyy")

Regards,
Jim Cone
San Francisco, CA

"Mervyn Thomas" wrote in message
...
How would I add a format to the current date in this bit of code. I want
dd/mm/yyyy:
ActiveSheet.PageSetup.CenterFooter = Date
Mervyn



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Format dates in VB

Thanks a million - I tried searching the useless help section for ages!

"Jim Cone" wrote in message
...
Mervyn,

Try this...
ActiveSheet.PageSetup.CenterFooter = Format$(Date, "dd/mm/yyyy")

Regards,
Jim Cone
San Francisco, CA

"Mervyn Thomas" wrote in message
...
How would I add a format to the current date in this bit of code. I

want
dd/mm/yyyy:
ActiveSheet.PageSetup.CenterFooter = Date
Mervyn





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Format dates in VB

On Fri, 30 Jan 2004 10:26:14 -0000, "Mervyn Thomas"
wrote:

How would I add a format to the current date in this bit of code. I want
dd/mm/yyyy:

ActiveSheet.PageSetup.CenterFooter = Date


If your copy of Windows is set up the appropriate way, all you need do
is assign the string "&D" to the CenterFooter property.

If you want the footer to appear that way regardless of the Windows
set up, you may be better off assigning it as a string:

ActiveSheet.PageSetup.CenterFooter= Format(date(),"dd/mm/yyyy")

Just remember that that IS a string, and that you'd need to refresh it
each time you wanted to print. But then I imagine that you have this
code in the Workbook_BeforePrint event anyway...

---------------------------------------------------------
Hank Scorpio
scorpionet who hates spam is at iprimus.com.au (You know what to do.)
* Please keep all replies in this Newsgroup. Thanks! *
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Format dates in VB

Mervyn,

Always best to format the dates in a neutral form

ActiveSheet.PageSetup.CenterFooter = format(Date, "dd mmm yyyy")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Mervyn Thomas" wrote in message
...
How would I add a format to the current date in this bit of code. I want
dd/mm/yyyy:

ActiveSheet.PageSetup.CenterFooter = Date

Mervyn






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
format dates to mm-dd-yy Wanna Learn Excel Discussion (Misc queries) 4 May 12th 09 02:38 AM
CONVERT DATES FROM EUROPEAN FORMAT TO US FORMAT les8 New Users to Excel 8 August 8th 06 05:48 PM
Format text 'dates' to real dates Jacy Excel Worksheet Functions 4 July 24th 06 02:10 AM
the dates on cell format make different dates. date formats morph the dates/chang case New Users to Excel 6 April 18th 05 02:41 AM
Format dates Tamer Seoud Excel Programming 1 November 27th 03 11:15 AM


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

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

About Us

"It's about Microsoft Excel"