Thread
:
Is Cell in Date Format
View Single Post
#
5
Posted to microsoft.public.excel.programming
JE McGimpsey
external usenet poster
Posts: 4,624
Is Cell in Date Format
Can you not ignore format if you create the label using
Format(ActiveCell.Value, "dd mmm yyyy hh:mm:ss")
(or whatever format string you want)...
You could check the NumberFormat property for a particular format, e.g.:
If ActiveCell.NumberFormat Like "*yy*" Then
'likely a date - or use *m/d*, *d/m*, etc
Else
'Do something else
End If
In article .com,
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
Reply With Quote
JE McGimpsey
View Public Profile
Find all posts by JE McGimpsey