![]() |
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 |
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 |
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 |
All times are GMT +1. The time now is 08:46 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com