Calendar Initialize

P

Patrick C. Simonds

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
 
G

Gary Keramidas

maybe something like this:

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

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

Top