Need help with pop-up calendar (Date & Time Picker)

JStreck

New Member
Joined
Apr 14, 2010
Messages
26
Okay, in need of more help.

I would like to create a drop down menu within a cell that brings up a calendar, from which the user can click a date and that date is populated into the cell w/the drop down.

So far, I've not been successful, other than using the calendar control, which is a full-time displayed calendar that is bound to a single cell. I have a column of cells that each will potentially have a different date. I would like each cell to have independent drop downs, from which dates can be selected and populated accordingly.

All I've been able to find that is remotely close is this: http://danielcurran.com/instructions/how-to-install-microsoft-date-time-picker-control-60-sp4/ Unfortunately, his recommended files that I downloaded did absolutely nothing. Any other ideas?

Thanks for looking.
 
Last edited:

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
You can use calendar control along with Worksheet_Change event to position the calendar next to the input cell.

This will not be exactly a dropdown, but pretty close.

Try this:
Insert a Calendar control on sheet. (if not named Calendar1, then change it in the code below)
Goto code module of the same sheet and paste the code below.

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Calendar1.Visible Then Calendar1.Visible = False
    If Target.Column <> 3 Or Target.Count > 1 Then Exit Sub
    Calendar1.Left = Target.Left + Target.Width
    Calendar1.Top = Target.Top + Target.Height
    Calendar1.Visible = True
    Calendar1.Value = Date
End Sub
Private Sub Calendar1_Click()
    ActiveCell = Calendar1.Value
    Calendar1.Visible = False
    ActiveCell.Select
End Sub
This will cause a calendar to pop up whenever you click any cell in column C (can be changed of course). On selecting a date from calendar, it will get entered in the active cell and control will disappear.
 
Upvote 0
You can use calendar control along with Worksheet_Change event to position the calendar next to the input cell.

This will not be exactly a dropdown, but pretty close.

Try this:
Insert a Calendar control on sheet. (if not named Calendar1, then change it in the code below)
Goto code module of the same sheet and paste the code below.

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Calendar1.Visible Then Calendar1.Visible = False
    If Target.Column <> 3 Or Target.Count > 1 Then Exit Sub
    Calendar1.Left = Target.Left + Target.Width
    Calendar1.Top = Target.Top + Target.Height
    Calendar1.Visible = True
    Calendar1.Value = Date
End Sub
Private Sub Calendar1_Click()
    ActiveCell = Calendar1.Value
    Calendar1.Visible = False
    ActiveCell.Select
End Sub
This will cause a calendar to pop up whenever you click any cell in column C (can be changed of course). On selecting a date from calendar, it will get entered in the active cell and control will disappear.

This is exactly what I was looking for. Thanks!

tusharm - I am not opposed to shareware at all, so thanks for the input.
 
Last edited:
Upvote 0
Okay, back again.

The calendar works perfectly, but I've run into another small issue (besides being picky :LOL:). Is there a way to get the date to populate with time? I have it referenced in a formula that subracts it from another cell with date and time. I tried to alter the code above, but keep getting run time errors.
 
Upvote 0
I just made a control button from right clicking in the menu select form and type in opencalendar in the assign macro box. This is of course is using the calendar control add in.
 
Upvote 0
I just made a control button from right clicking in the menu select form and type in opencalendar in the assign macro box. This is of course is using the calendar control add in.

Thanks for the response. Are you suggesting I use this vs. the method above? The method above is working great, I just need to know if I can have it populate date and time (default of 23:99:00 is preferable) instead of just the date. Will the option you are suggesting do that?
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,025
Members
448,939
Latest member
Leon Leenders

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