Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Calendar Initialize

Is there any way in which this can be amended so that the date selected when
the calendar is displayed that the next Sunday is selected (unless the
current day is Sunday then I want the date to be the current date)



Private Sub UserForm_Initialize()

Calendar1 = Now()

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Calendar Initialize

maybe something like this:

If Weekday(Date, vbSunday) = 1 Then
Calendar1 = Date
Else
Calendar1= Date + 8 - Weekday(Date, vbSunday)
End If

--


Gary


"Patrick C. Simonds" wrote in message
...
Is there any way in which this can be amended so that the date selected when
the calendar is displayed that the next Sunday is selected (unless the current
day is Sunday then I want the date to be the current date)



Private Sub UserForm_Initialize()

Calendar1 = Now()

End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Calendar Initialize

Try this...

Calendar1 = Now + (8 - Weekday(Now)) Mod 7

Rick


"Patrick C. Simonds" wrote in message
...
Is there any way in which this can be amended so that the date selected
when the calendar is displayed that the next Sunday is selected (unless
the current day is Sunday then I want the date to be the current date)



Private Sub UserForm_Initialize()

Calendar1 = Now()

End Sub


Reply
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
Userform Initialize [email protected] Excel Programming 4 August 7th 07 06:01 AM
UserForm initialize Arne Hegefors Excel Programming 8 September 8th 06 01:48 PM
userform initialize Patrick Simonds Excel Programming 1 August 4th 06 11:14 PM
Initialize an array Kleev Excel Programming 6 December 1st 05 06:09 PM
Initialize macro Tom Jung Excel Programming 1 October 31st 05 04:04 AM


All times are GMT +1. The time now is 11:19 AM.

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"