Date Picker on drop down list selection

jvinces

New Member
Joined
Dec 9, 2022
Messages
6
Office Version
  1. 2016
Platform
  1. Windows
Is there a way where I can have date picker hidden, then when I choose an option from a drop down list, lets say something with the word "date" in it, date picker becomes visible?
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Using Sheet1 for the list of Dates

copy the code below in sheet 2 in VBA. Note this is not a Module
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("A1") = "date" Then ' type the word date in cell A1 of sheet 2 the below validation will appear in cell A2
    With Range("A2").Validation ' location of where you want the list of dates picker to be
        .Delete
        .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
        xlBetween, Formula1:="=Sheet1!$A$1:$A$28" ' location of where your date list is
        .IgnoreBlank = True
        .InCellDropdown = True
        .InputTitle = ""
        .ErrorTitle = ""
        .InputMessage = ""
        .ErrorMessage = ""
        .ShowInput = True
        .ShowError = True
    End With
Else
Range("A2") = ""
Range("A2").Validation.Delete
End If
End Sub
 
Upvote 0
Thanks for taking the time to write that code. Is there a way to tie a date picker to a specific cell? As far I knew I could only link a cell to the date picker to display the dates that I chose.
 
Upvote 0
With Range("A2").Validation ' location of where you want the list of dates picker to be
so this part of the code in the example show the date picker to be in A2 in sheet 2. If I understand your request simply change the "A2" to where you want the Date Picker to be
 
Upvote 0
Gotcha, so I think we might be referring to two separate things in terms of "date picker". I'm referencing the MS Date and Time Picker Control 6.0 that you add through the Developer tab. When that ActiveX Control is added, it's just a free moving control, I can't attach it to a specific cell; unless there is a way to do that and I haven't figure it out yet lol.
 
Upvote 0
Gotcha, so I think we might be referring to two separate things in terms of "date picker". I'm referencing the MS Date and Time Picker Control 6.0 that you add through the Developer tab. When that ActiveX Control is added, it's just a free moving control, I can't attach it to a specific cell; unless there is a way to do that and I haven't figure it out yet lol.
Sorry I am not familiar with how to locking ActiveX Control. That would be a different request from the original Post. Might want to suggest that you create a new request with that specific request hopefully someone else that knows will help out.

Did the vba posted help you to hide the date picker. Were you able to modify to show the Picker.
 
Upvote 0
Sorry I am not familiar with how to locking ActiveX Control. That would be a different request from the original Post. Might want to suggest that you create a new request with that specific request hopefully someone else that knows will help out.

Did the vba posted help you to hide the date picker. Were you able to modify to show the Picker.
You can close this thread.
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,318
Members
452,634
Latest member
cpostell

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