Home |
Search |
Today's Posts |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check how date is entered
On 5/4/2018 8:42 PM, GS wrote:
... Ambiguities arise when *numeric representation* displays as opposed to *textual representation* displaying. Auric's code determines whether the 1st element represents d or m. Isn't this what the OP wants to figure out? ... Yeah, but it depends on what point it is in the process; is it the format of the cell that determines or the data string going into the cell? I was presuming it was the latter in which case how the cell is formatted is the answer to a question as to how Excel interpreted the string but doesn't _necessarily_ mean that was what the date was from whence it came. That's not how it works! Dates aren't strings same as currencies arn't strings! Excel uses the *system* date format by default to display the 'DateSerial' in the cell to determine the dmy/mdy of a date based on that system's date format. So.., when working with a file created in XP that has date cells, the DateSerial is used to determine the datevalue in later OSs. This avoids all ambiguity as to the true date being displayed. The ambiguity for the user arises when the cell format is numeric (05/04/2018) if/when the system date format isn't known. Using a textual format eliminates the ambiguity because it displays the month name based on the DateSerial of the value in the date cell. (What's important to remember here is that what cells display isn't necessarily what they contain; -what we see is just how the cells are/were formatted to display their contents. -- 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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Check for duplicate numbers from ones entered and anoter set | Excel Programming | |||
Dates - Need to display date one month prior to user-entered date | Excel Worksheet Functions | |||
Date subtraction -How to not show negative when 2nd date not entered | New Users to Excel | |||
Check Mark appears when a letter is entered in a field | Excel Programming | |||
Macro to check if data has been entered | Excel Programming |