Date picker on a specific cell Excel 2010

Miguelluis

New Member
Joined
Jan 29, 2013
Messages
45
Hi

I'm trying to add a date picker to a sheet that will run when a user selects a cell in column A. I got as far as being able to run it any where on my workbook but I am having problems containing it to column A nor can I figure out how to make the date picker appear when I select a cell in column A.

With a youtube videao I created a form and a module and the code for this is below, Is any one able to help me run this when a user selects a cell in column A?

Form code:


Private Sub cmdClose_Click()
Unload Me
End Sub




Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
On Error Resume Next
Dim cell As Object
For Each cell In Selection.Cells
cell.Value = Me.MonthView1.Value
Next cell
Unload Me
End Sub




Private Sub UserForm_Initialize()
If IsDate(ActiveCell.Value) Then
Me.MonthView1.Value = ActiveCell.Value
End If
End Sub
------------------------------------------------------------------------------

Workbook code:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
Application.OnKey "+^{C}"
Application.CommandBars("cell").Controls("Insert Date").Delete
End Sub


Private Sub Workbook_Open()
On Error Resume Next
Dim newcontrol As CommandBarControl
Application.OnKey "+^{C}", "Module1.OpenCalendar"
Application.CommandBars("cell").Controls("Insert Date").Delete
Set newcontrol = Application.CommandBars("Cell").Controls.Add
With newcontrol
.Caption = "Insert Date"
.OnAction = "Module1.OpenCalendar"
.BeginGroup = True
End With
End Sub
------------------------------------------------------------------



Module Code:


Sub OpenCalendar()
frmcalendar.Show
End Sub

Thank you
Miguel
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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
Back
Top