Home |
Search |
Today's Posts |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Converting dates
It even works when the input date string has hyphens, such as: "1-3-2019" ' This gets converted to "01/03/19" "1-3" ' This also gets converted to "01/03/19" I forgot to ask, how can I test if the input string does NOT resemble a date string (or even a date string with hyphens like above)? This is why I suggested you play with the Date NumberFormats AFTER running the code! If you start with a clean sheet and select A1:D3 as a group, then run the code, THEN try different date formats for the selection. Note that the left-aligned content is text AND the right-aligned content is a date. Observe the FormulaBar contents while navigating the selection via the Enter key to see the actual cell values versus what displays. As you can see, hyphens are a built-in format in dates and so is interpreted correctly; - the only other character that is correctly interpreted is the forward slash. Let your curiosity run wild and enjoy the exercise!!<g -- 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 | |||
Converting Julian Dates to regular dates | Excel Worksheet Functions | |||
Converting Dates | Excel Worksheet Functions | |||
Converting Text dates into dates | Excel Programming | |||
Converting Dates | Excel Programming | |||
converting dates | Excel Programming |