LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Restricting available dates in calendar userform

I have developed a userform calendar in my spreadsheet, but I need to
know how to restrict the dates that can be selected to Friday's ONLY.


You could simply select the Friday for the week of any day the user clicks
on. Here is the code to do that

For a Calendar Control
===================
Private Sub Calendar1_Click()
With Calendar1
.Value = .Value + 6 - Weekday(.Value)
End With
End Sub


For a MonthView Control
===================
Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
With MonthView1
.Value = .Value + 6 - .DayOfWeek
End With
End Sub


Rick

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Restricting use of Calendar Control Patrick Simonds Excel Programming 4 March 30th 06 05:25 AM
Calendar ToolBox in a UserForm Michael Vaughan Excel Programming 2 September 27th 05 09:09 PM
calendar userform peter Excel Programming 3 June 16th 04 06:11 PM
Calendar in UserForm cogent Excel Programming 4 May 14th 04 02:01 AM
Calendar in UserForm Soniya Excel Programming 2 August 27th 03 05:24 PM


All times are GMT +1. The time now is 10:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"