Hi anyone,
The following code opens the calendar form when assigned cell is formatted date either as "m/d/yy;@" or "d/m/yy;@".
How could the code be changed so that it pop ups the calendar form when the system date is formatted as short date either m/d/yy or d/m/yy?
Any help on this would be kindly appreciated.
The following code opens the calendar form when assigned cell is formatted date either as "m/d/yy;@" or "d/m/yy;@".
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'check cells for desired format to trigger the calendarfrm.show routine
'otherwise exit the sub
Dim DateFormats, DF
DateFormats = Array("m/d/yy;@", "mmmm d yyyy")
For Each DF In DateFormats
If DF = Target.NumberFormat Then
If CalendarFrm.HelpLabel.Caption <> "" Then
CalendarFrm.Height = 191 + CalendarFrm.HelpLabel.Height
Else: CalendarFrm.Height = 191
CalendarFrm.Show
End If
End If
Next
End Sub
How could the code be changed so that it pop ups the calendar form when the system date is formatted as short date either m/d/yy or d/m/yy?
Any help on this would be kindly appreciated.