View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Robert Crandal Robert Crandal is offline
external usenet poster
 
Posts: 309
Default 2nd question - Calendar Control 8.0

I found some code on the Internet that describes how to add
the "Calendar Control 8.0" onto your Excel spreadsheet.
It explains to first create a Userform and then to place the
control on top of the Userform.

The website then explains to paste the following code into your
Userform module:

Private Sub Calendar1_Click()

ActiveCell = Calendar1.Value
ActiveCell.NumberFormat="mm/dd/yy"

End Sub

Private Sub UserForm_Activate()

Me.Calendar1.Value = Date

End Sub

I understand the code for "Calendar1_Click()", but can someone
help me understand the code for "UserForm_Activate()"???
I'm not sure why this code is necessary or what it does?? I am
able to delete the code in "UserForm_Activate()" and the calendar
control still works fine without it, so I just want to know what it does.

Thank you!