Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Date format using VBA

I would like to format a range of cells using VBA to only
accept the mm/dd/yy date format. Also, is it possible to
pre-populate each of those cells where the user would
see " / / " and they just fill in the spaces?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Date format using VBA

Sounds like a bad idea. Dates are not stored as mm/dd/yy - they are stored
as a number of days from a base date. So any valid date format is
acceptable - Excel will see this as a date and generate the date serial.
You can format the cell to show mm/dd/yy format - but it is counter
productive to try to force the user to enter the data in a specific format.

If you put a zero in the cell it will display as

00/00/00
But that is about as close to / / as you can get unless you either put in
/ / manually or produced it with a formula and in either case, it would
get overwritten by the user making an entry.

--
Regards,
Tom Ogilvy


"Jeff" wrote in message
...
I would like to format a range of cells using VBA to only
accept the mm/dd/yy date format. Also, is it possible to
pre-populate each of those cells where the user would
see " / / " and they just fill in the spaces?



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
permanent conversion of 1904 date format to 1900 date format Jos Excel Worksheet Functions 4 November 26th 15 02:48 PM
How do I convert dd/mm/yy date format to yyddd Julian date format itzy bitzy[_2_] Excel Worksheet Functions 8 December 11th 09 03:20 AM
change date format dd/mm/yyyy to Julian date format? itzy bitzy Excel Worksheet Functions 1 December 8th 09 07:42 PM
Convert european foreign date format to US date format EAL Excel Worksheet Functions 1 May 14th 09 10:02 PM
Convert date + time text format to date format Paul Ho Excel Worksheet Functions 2 May 22nd 07 05:47 PM


All times are GMT +1. The time now is 01:27 PM.

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"