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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

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,123,341
Messages
5,601,059
Members
414,426
Latest member
Rutuja kokane

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top