LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Day test question

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
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
Logical Test Question Tom Excel Discussion (Misc queries) 2 May 24th 08 12:06 AM
Test question colmkav Excel Discussion (Misc queries) 2 January 17th 07 09:20 PM
Test question colmkav Excel Discussion (Misc queries) 3 January 17th 07 05:16 PM
Logical test question stevieboy1313 Excel Worksheet Functions 1 August 28th 06 12:33 AM
test for date in column question Buster Excel Worksheet Functions 1 December 10th 04 04:38 AM


All times are GMT +1. The time now is 04:31 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"