Hi, thanks for the tip. I'm tried using the format number property but it didn't work.
I made a mistake in my previous post. The cell is not formatted as a date, but rather its Category is set to Date in the Format Cells option. Now I need a way to open a form which contains a calendar whenever someone clicks on one of those cells.
The format does not cause any validation, it only describes how the cell contents is displayed. When the cell is being formatted, its category and further details, if exist, are set. So you can either test 'NumberFormat' string to be valid date format or test the contents for valid data (positive response for proper data string too). The latter:
Code:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
MsgBox IsDate(Target)
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.