Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can run the text through the datevalue function to determine if it is a
valid date On Error Resume Next xyz = DateValue("89:98") If Err.Number < 0 Then MsgBox ("Date entered is not a valid date") End If On Error GoTo 0 "Tom Ogilvy" wrote: If you don't want to parse the numberformat property, you could put a number in it and check the vartype: Activecell.Value = 1 ? vartype(activecell.Value) = vbDate True then clearcontents the cell. -- Regards, Tom Ogilvy " wrote: I have a userform that has a text label that reports the calendar date/ time in the format of the activecell. All works fine when the cell has been formated to a date format but it gets reported back in various odd ball forms when in General format, currency, %, fraction etc. This occurs when the cell has not yet been formated to a date It there a way I can used to to determine if the cell is in a date format so I can change the label in these situations The isdate function will tell if the cell is a date but I need to know the cell format before data is entered. TIA |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cell Format Overrides to Date Format | Excel Worksheet Functions | |||
Format date in a cell | Excel Discussion (Misc queries) | |||
How can I get date of file creation to XLS cell in date format? | Excel Worksheet Functions | |||
How do I format a cell to a date format? | Excel Discussion (Misc queries) | |||
cell format for date/time in same cell excel 2003 | Excel Worksheet Functions |