Selecting proper week

  • Thread starter Thread starter Patrick Simonds
  • Start date Start date
P

Patrick Simonds

I have a dialog box with four calendars on it. What I need to have happen
is:

If I click on the second Thursday of a month on calendar1 then the second
Thursday of the month will be selected on the following calendar2. this is
easy enough with the following code:

Calendar2 = Calendar1 + 14

My problem is that if I select the 4th Thursday of the month (and it is
worth noting, only the second and 4th Thursdays are used) using the code
above will not necessarily get me the 2nd Thursday of the following month.
For example, if I select the 4th Thursday of march (2005) the code
"Calendar2 = Calendar1 + 14" gives me the 1st Thursday of April.

Any creative solutions are welcome.
 
Use the following logic:

if calendar1 and calendar1+7 are in different months, use calendar1+14
if calendar1 and calendar1+7 are in the same month, use calendar1+21

Have a good day
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Calendar problem 9
Userform 1
Calendar question 3
Number of days between dates (Calendar) 1
Which day 5
Calculating Pay Periods 4
“Calendar Control†to Insert Dates 4
Making a sports league schedule 2

Back
Top