Calendar Control

yash

New Member
Joined
Oct 29, 2004
Messages
18
Hi guys,

I need a free calendar control to use in a userform in excel VBA. Please let me know instructions on how to use this also, if possible.

Thanks,
Yash :eek:
 

Some videos you may like

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Oorang

Well-known Member
Joined
Mar 4, 2005
Messages
2,071
There is already one built in.
In the VBE goto Tools, Reference, Browse, All File Types and make a reference to C:\Program Files\Microsoft Office\Office10\mscal.ocx
This will create an entry that says something to the effect of microsoft calander control. Place a check mark in teh box next to it and press ok.
Then goto tools, additional controls and add Calander Control 10.0. This will add a item to your controlbox that looks like a grid. It will be your calander. Here is some sample code on how you might interact with it.

Code:
Private Sub Calendar1_Click()
Selection = Calendar1.Value
Unload Me
End Sub

Private Sub CommandButton1_Click()

Calendar1.Value = Date
Selection = Calendar1.Value
Unload Me
End Sub

Private Sub CommandButton2_Click()
Unload Me
End Sub

Private Sub UserForm_Initialize()
If IsDate(ActiveCell.Value) Then
      Calendar1.Value = DateValue(ActiveCell.Value)
Else
      Calendar1.Value = Date
End If
End Sub
 

Oorang

Well-known Member
Joined
Mar 4, 2005
Messages
2,071
Did you try using the below instructions with office 11? (Cuase they should work)
 

RAM

Well-known Member
Joined
Oct 4, 2004
Messages
1,862

ADVERTISEMENT

There is no mscal.ocx to be found. No ocx file at all.

RAM
 

XLGibbs

Well-known Member
Joined
Feb 25, 2005
Messages
2,446
RAM,

You should be able to see it as a control using Insert Object from the code window. If Calendar control is not there, you may not have MS Access installed on your machine. As I understand things, it is the mscal.ocx is installed as part of the Access libraries...
 

RAM

Well-known Member
Joined
Oct 4, 2004
Messages
1,862

ADVERTISEMENT

Insert - Object. There is no Calendar control under the Create New tab. No, I don't have Access.

RAM
 

RAM

Well-known Member
Joined
Oct 4, 2004
Messages
1,862
I will try that. I'll let you know.

Thanks,

RAM
 

Watch MrExcel Video

Forum statistics

Threads
1,119,002
Messages
5,575,483
Members
412,668
Latest member
Lukep22
Top