ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Userform Calendar - Current Date (https://www.excelbanter.com/excel-programming/406753-userform-calendar-current-date.html)

D

Userform Calendar - Current Date
 
How do you get the Calendar to open with the current date selected. Here is
what I have but it is not working. The calendar opens with the
date in which I created the calendar. The name of my Calendar is Calendar1.
I have tried setting the properties for the month, day, year, to be 0.

Private Sub frmCalendar_Open()
Calendar1.Value = Date

End Sub



John

Userform Calendar - Current Date
 
try placing your code in the userforms intialize event:

Private Sub UserForm_Initialize()
Calendar1.Value = Date
End Sub
--
JB


"D" wrote:

How do you get the Calendar to open with the current date selected. Here is
what I have but it is not working. The calendar opens with the
date in which I created the calendar. The name of my Calendar is Calendar1.
I have tried setting the properties for the month, day, year, to be 0.

Private Sub frmCalendar_Open()
Calendar1.Value = Date

End Sub




All times are GMT +1. The time now is 05:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com