Use Date Picker to Locate and Select a Cell

raccoon588

Board Regular
Joined
Aug 5, 2016
Messages
118
Is there a way to code a DatePicker so that when you choose a date it will look in column A and select the cell that date it in? so if i choose 11/1/2019 in the date picker it will look through column A, find the date, and select the cell.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Change the date picker number (in red) to match the one you are using. Close the code window to return to your sheet.
Code:
Private Sub DTPicker[COLOR="#FF0000"]21[/COLOR]_Change()
    Dim fnd As Range
    Set fnd = Range("A:A").Find(DTPicker[COLOR="#FF0000"]21[/COLOR].Value)
    If Not fnd Is Nothing Then
        fnd.Select
    End If
End Sub
 
Last edited:
Upvote 0
Obviously, change the sheet ref & DTPicker name, to suit...
Code:
Private Sub DTPicker1_Change()
Dim cl As Long
Dim lstrw As Long

On Error GoTo exit_sub
    With Sheets("Sheet11")
 lstrw = .Range("A65536").End(xlUp).Row
    
    .Range("A" & .Range("A1:A" & lstrw).Find(Me.DTPicker1.Value).Row).Select
    End With
exit_sub:
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,021
Latest member
Justyna P

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