I need to create an in cell date picker for a excel worksheet I'm creating.
I'm trying to follow this tutorial
However i cant understand how the example is supposed to place a calendar picker in cell A1:C1
. In my worksheet, if i paste the code as is, it throws an error. if i try to modify it like so:
'Declaration
Public Function AddDateTimePicker(range As range, name As String) As DateTimePicker
Private Sub ExcelRangeAddDateTimePicker()
Dim DateTimePicker1 As Microsoft.Office.Tools.Excel.Controls.DateTimePicker
DateTimePicker1 = Me.Controls.AddDateTimePicker(Me.range("A1", "C1"), "DateTimePicker1")
End Sub
I get no result at all...
Any tip or answer is appreciated :)
ocx is registered, restart Excel, go to the "Developer" tab, click "Insert" -> "More Controls", the Microsoft Date and Time Picker control will appear.
Step 1: Click on the Insert tab in the Controls group and select More Controls from ActiveX Controls (bottom right of the list of controls). Step 2: Select Microsoft Date and Time Picker Control 6.0 (SP6) from the list and click OK. Step 3: To create the drop-down calendar in excel, click any location on the worksheet.
If the tool doesn't show up in the More Controls dialog box, then it has not been installed on your system. If you are using a 64-bit version of Office, then you won't be able to install the control. The reason is because MSCOMCT2. OCX works only on 32-bit systems.
I found a better example for a working Excel 2010 Calander than what i had discovered previously.
This Tutorial is really good, and helps you to create a pop up Calander for Excel 2010: http://www.fontstuff.com/vba/vbatut07.htm
I found it at the bottom of the page linked by brettdj. Thank you :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With