LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Calendar problem

If you try this staring with the second week of March (2005) you will see
that in April it is the first and third Tuesday selected.


"Patrick Simonds" wrote in message
...
Thanks for the try, but that does not seem to work either.

"Patrick Molloy" wrote in
message ...
Private Sub Calendar1_Click()
Dim date1 As Date
Dim date2 As Date
date1 = DateSerial(Calendar1.Year, Calendar1.Month, 1)
Do Until Weekday(date1, vbMonday) = 2
date1 = date1 + 1
Loop
date1 = date1 + 7 'set 2nd Tuesdaye
date2 = date1 + 14 '4th tuesday

Select Case Calendar1.Value
Case date1
Calendar2.Value = Calendar1.Value + 14
Calendar3.Value = Calendar1 + 28
Calendar4.Value = Calendar1.Value + 42
Case date2
Calendar2.Value = date1 + 28
Calendar3.Value = Calendar1 + 28
Calendar4.Value = Calendar2 + 28
Case Else

End Select


End Sub

"Patrick Simonds" wrote:

I have a dialog box which contains 4 Calendars. The 4 calendars are set
up
so that when you click on the 2nd or 4th Tuesday of the first calendar
the
other calendars would progressively show the next Tuesday which was 2
weeks
away, see code below.

It turns out that what I need to have happen, is that if I select the
2nd
Tuesday (say of September) on Calendar1 then Calendar2 should have the
4th
Tuesday of September selected, Calendar3 the second Tuesday of October
and
Calendar4 would display the 4th Tuesday of October. Of course if I had
started with the 4th Tuesday of September the I would need the 2nd
Tuesday
of October and so on.

So it is obvious my code can not do this, so does anyone have an idea
how I
might make this work?



Private Sub Calendar1_Click()

Calendar2 = Calendar1 + 14
Calendar3 = Calendar1 + 28
Calendar4 = Calendar1 + 42

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
find free sharware to include calendar pop or use calendar in cell ednc Excel Discussion (Misc queries) 2 April 14th 08 05:05 PM
how do i export excel calendar info to outlook calendar? Maggie Excel Discussion (Misc queries) 1 December 31st 07 10:27 PM
import calendar items from excel into outlook calendar jsewaiseh Excel Discussion (Misc queries) 0 September 2nd 05 03:53 PM
Calendar Problem- What's Wrong? joe smith Excel Discussion (Misc queries) 6 March 22nd 05 10:36 PM
Calendar object in Excel problem - mscal.ocx jancmar Excel Programming 0 October 2nd 03 10:41 PM


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