Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I asked this question a couple of days ago and got a response (but the
response while it would work, did not fit into how I wanted to set up my form) so I thought I would try one more time: Is there any way to lock a Calendar control in such a way that someone could only select a Thursday? Ideally the last Thursday of the month. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Worked out my own solution. My not look pretty, but it works:
Private Sub Calendar1_Click() Dim MyDate, MyWeekDay MyDate = Calendar1.Value ' Assign a date. MyWeekDay = Weekday(MyDate) If MyWeekDay = 5 Then Exit Sub End If Unload Calendar WrongDay.Show End Sub "Patrick Simonds" wrote in message ... I asked this question a couple of days ago and got a response (but the response while it would work, did not fit into how I wanted to set up my form) so I thought I would try one more time: Is there any way to lock a Calendar control in such a way that someone could only select a Thursday? Ideally the last Thursday of the month. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Patrick,
This any better ? Private Sub Calendar1_Click() With Calendar1 'Is it any Thursday If Weekday(.Value) = vbThursday Then 'Is it the last Thursday If Month(.Value) = Month(.Value + 7) Then 'Same month so cannot be last Thursday MsgBox "Not last Thursday in this month" Else MsgBox "Date OK" End If Else MsgBox "Not a Thurday" End If End With End Sub NickHK "Patrick Simonds" wrote in message ... Worked out my own solution. My not look pretty, but it works: Private Sub Calendar1_Click() Dim MyDate, MyWeekDay MyDate = Calendar1.Value ' Assign a date. MyWeekDay = Weekday(MyDate) If MyWeekDay = 5 Then Exit Sub End If Unload Calendar WrongDay.Show End Sub "Patrick Simonds" wrote in message ... I asked this question a couple of days ago and got a response (but the response while it would work, did not fit into how I wanted to set up my form) so I thought I would try one more time: Is there any way to lock a Calendar control in such a way that someone could only select a Thursday? Ideally the last Thursday of the month. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Another approach would be to use a list box with only the last
Thursday of each month listed. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Patrick Simonds" wrote in message ... I asked this question a couple of days ago and got a response (but the response while it would work, did not fit into how I wanted to set up my form) so I thought I would try one more time: Is there any way to lock a Calendar control in such a way that someone could only select a Thursday? Ideally the last Thursday of the month. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Patrick,
Jim's solution is probably better. I find it frustrating when I am apparently given the choice of all these options, but for some unknown reason cannot choose them. Why give the user all the days of the month if only a single day is valid ? NickHK "Jim Cone" wrote in message ... Another approach would be to use a list box with only the last Thursday of each month listed. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Patrick Simonds" wrote in message ... I asked this question a couple of days ago and got a response (but the response while it would work, did not fit into how I wanted to set up my form) so I thought I would try one more time: Is there any way to lock a Calendar control in such a way that someone could only select a Thursday? Ideally the last Thursday of the month. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Control disappeared problem - specifically, the Calendar Control | Excel Programming | |||
calendar control 10.0 | Excel Programming | |||
calendar control | Excel Programming | |||
Calendar Control: Can't exit design mode because control can't be created | Excel Programming | |||
Calendar Control | Excel Programming |