View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Les[_4_] Les[_4_] is offline
external usenet poster
 
Posts: 21
Default Create a calendar object in Excel Cell

I have, and following works for all Workbooks OK for me. I am
using MS Office 2000

Create a form and place a Calendar Control 9.0 which you can find
from the Tools/Additional Controls/Calendar Control 9.0 menu.

Then in the Calendar Code I have
-----------------------------------------
Private Sub Calendar1_Click() ' what happens when user clicks on
control
With ActiveCell
.NumberFormat = "dd-mmm-yyyy" ' format to my preference
.Value = Format(Calendar1.Value, "dd-mmm-yyyy") ' insert
clicked date
End With
Unload Me ' closes and unloads Calendar
End Sub
-----------------------------------------
Private Sub UserForm_Initialize() ' what happens when user opens
form containing Calendar
If IsDate(ActiveCell.Value) Then
Calendar1.Value = DateValue(ActiveCell.Value) ' uses cell
value if date
Else
Calendar1.Value = Date ' uses today's date as default
End If
End Sub

-----------------------------------------
and in a general module I have
-----------------------------------------
Private Sub OpenCalander() ' user clicks button to open Calendar
frmCalendar.Show ' shows Calendar
End Sub
-----------------------------------------

I have all this in Personal.xls and a menu button to run the
OpenCalendar sub which works on all opened workbooks.

regards,
--
Les Hay, Livingston. Scotland
"Kzeto" wrote in message
...
Hi,
I was wondering did anyone try to insert an calendar objcect

into an Excel
Cell before.

thank you.


--
Khai Mun, Ng
-----------------------------------------------------------