ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Calendar Control Action (https://www.excelbanter.com/excel-programming/329664-calendar-control-action.html)

Excel User

Calendar Control Action
 
I added a calendar control to a workbook and it doesn't close after I select
a date (I have to manually click the red "close" box).
What command should I add in which module so that the calendar will close
automatically upon clicking on a date?
Below are the three modules that operate the calendar:

Private Sub Calendar1_Click()
ActiveCell = Calendar1.Value
End Sub

Private Sub UserForm_Activate()
Me.Calendar1.Value = Date
End Sub

Sub_ShowIt()
UserForm1.Show
End Sub

Thanks!

Ron de Bruin

Calendar Control Action
 
Use
Unload Me
in the click event after ActiveCell = Calendar1.Value

See my site for more example code
http://www.rondebruin.nl/calendar.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Excel User" <Excel wrote in message ...
I added a calendar control to a workbook and it doesn't close after I select
a date (I have to manually click the red "close" box).
What command should I add in which module so that the calendar will close
automatically upon clicking on a date?
Below are the three modules that operate the calendar:

Private Sub Calendar1_Click()
ActiveCell = Calendar1.Value
End Sub

Private Sub UserForm_Activate()
Me.Calendar1.Value = Date
End Sub

Sub_ShowIt()
UserForm1.Show
End Sub

Thanks!




Excel User

Calendar Control Action
 
It works. Thank you very much, Ron. I appreciate your valuable help.
Great website, too--I have it bookmarked! Your QDE and Easy Filter add-ins
looks great--I'll be using them soon.
Thanks again.
Regards,
EU

"Ron de Bruin" wrote:

Use
Unload Me
in the click event after ActiveCell = Calendar1.Value

See my site for more example code
http://www.rondebruin.nl/calendar.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Excel User" <Excel wrote in message ...
I added a calendar control to a workbook and it doesn't close after I select
a date (I have to manually click the red "close" box).
What command should I add in which module so that the calendar will close
automatically upon clicking on a date?
Below are the three modules that operate the calendar:

Private Sub Calendar1_Click()
ActiveCell = Calendar1.Value
End Sub

Private Sub UserForm_Activate()
Me.Calendar1.Value = Date
End Sub

Sub_ShowIt()
UserForm1.Show
End Sub

Thanks!






All times are GMT +1. The time now is 10:29 AM.

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