LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #23   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default Check how date is entered

1) Enter 5/6/2017 into A1 and A2 initially formatted as General
2) Observe the Excel converted both to Date as mm/dd/yyyy
3) Apply Custom format of dd/mm/yyyy to A2
4) Observe the display change to 6/5/2018 -- looks good, doesn't it?
5) Enter =A1 and =A2 into B1 and B2
6) Format B1 and B2 as d-mmm
7) Observe both read 6-May!!!


Of course it does! What were you expecting?

If you format all the cells as Text, you'll see that the underlying DateSerial
for the value entered is 43226 (May 6, 2018). It doesn't matter how you format
it to display because the DateSerial drives the result. My point is *why
deliberately use an ambiguous format* to display dates given the issue? This is
what my exercise demos!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 
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
Check for duplicate numbers from ones entered and anoter set Goldie Excel Programming 1 May 29th 09 08:47 AM
Dates - Need to display date one month prior to user-entered date brettopp Excel Worksheet Functions 13 December 3rd 07 05:58 PM
Date subtraction -How to not show negative when 2nd date not entered Edward[_2_] New Users to Excel 2 September 27th 07 03:03 PM
Check Mark appears when a letter is entered in a field Gina Excel Programming 2 February 22nd 07 08:23 PM
Macro to check if data has been entered Mike R. Excel Programming 1 December 20th 04 11:14 PM


All times are GMT +1. The time now is 12:55 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"