Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The code below ensures that the date selected (on Calendar1) is a Thursday
and works fine. The intent here to create an annual vacation book, and because of how the book is printed it needs to start on a Thursday. Calendar1 is set to show the month of January when it opens. What I need now is some way to amend the code so that if January 1 does not fall on a Thursday, that they can only select the Thursday prior to January 1. Sub Thursday_Test() Dim MyDate, MyWeekDay MyDate = DVal '= Date selected on Calendar1 MyWeekDay = Weekday(MyDate) If MyWeekDay = 5 Then ActiveCell.Value = DVal Unload Calendar RenameWorksheets.Rename_Worksheets Exit Sub End If Unload Calendar WrongDay.Show End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Logical Test Question | Excel Discussion (Misc queries) | |||
Test question | Excel Discussion (Misc queries) | |||
Test question | Excel Discussion (Misc queries) | |||
Logical test question | Excel Worksheet Functions | |||
test for date in column question | Excel Worksheet Functions |