Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 29th, 2008, 07:23 PM
Authorized User
 
Join Date: Jun 2008
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to mona_upm84
Default Workbook_BeforePrint (Date format)

Hi all,

I need a help about format of date. For current coding, i use
.CenterFooter = "&D"
where the format of the date will be default as 30/7/2008. I need to make it as 30-Jul-2008 because this data might be send to America and it is easier to have this (dd-Mmm-yyyy) format to avoid any misunderstanding of the date.

I tried
.CenterFooter = "&Format(Now(), dd-Mmm-yyyy)"
but as the result, it appeared as "filename.xlsormat(Now(), dd-Mmm-yyyy)". Please help me. It seems like easy, but i didnt know the right code to type.



 
Old July 29th, 2008, 10:07 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

Please use

.CenterFooter = Format(Now(), "dd-Mmm-yyyy")

Cheers
Shasur

http://www.dotnetdud.blogspot.com

VBA Tips & Tricks (http://www.vbadud.blogspot.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
date format differs, need to force format somehow patricolsson ASP.NET 2.0 Basics 1 December 3rd, 2009 12:53 AM
Convert British format date to American format? fyr PHP How-To 0 December 19th, 2007 03:17 PM
Format Date Tim Johnson Access 1 December 17th, 2007 08:18 AM
How to give Date format while entering date Subuana Beginning VB 6 4 March 17th, 2006 07:25 AM
date format differs, need to force format somehow patricolsson HTML Code Clinic 2 January 12th, 2006 05:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.