View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.programming
dpb dpb is offline
external usenet poster
 
Posts: 109
Default Check how date is entered

On 5/5/2018 8:50 AM, GS wrote:
No contest on the above...


I've re-read the OPs ? and _guess_ I now think he probably was meaning
retrieved from a cell and therefore already in Excel so knowing which
way the cell is formatted answers the question.


Exactly my point; - using a textual format eliminates the ambiguity!

....

My point was that if it is formatted as a date in Excel there's never
any ambiguity as to what Excel thinks it is -- the question for such as
OP gave is whether the format itself is the correct one for the given
input string -- and _THAT_ question is indeterminate from only the data
OP provided.

There's a _visual_ ambiguity to the user if they don't know whether the
originator of the spreadsheet (or they forget themselves) whether the
format is mm/dd or dd/mm and all there is contained in the particular
cell or group of cells are month/day combinations that are in range from
1:12 so there is no other unambiguous reference. That's the question
that any VBA or cell function can answer for those cells; it still can't
answer the question of whether those values when entered were indeed in
the one format or the other of the two choices before being input to the
cell with that formatting/interpretation.

Changing to mmm can remove that visual ambiguity; even that can't
resolve the underlying question on the actual value, it can reflect the
chosen coding of the underlying cell in a different display format.

--