how to debug.print datepicker value

Pookiemeister

Well-known Member
Joined
Jan 6, 2012
Messages
626
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
As the title states, how do I get the value of the date picker by debug.print.

Thank you
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Code:
Private Sub DTPicker1_Change()
    Debug.Print "Date selected: " & DTPicker1.Value
End Sub
put this in the code module of the parent object (a Sheet or an UserForm) of the DTPicker and adjust the picker object name.
The result of the code can be found in the Immediate window of VBE (alt+F11 -> Ctrl+G)
 
Last edited:
Upvote 0
Now I am wondering? Is it possible to format a DTPicker value without the forward slashes? i.e. 03122019 or 3122019. Thank You.
 
Upvote 0
Code:
Private Sub DTPicker1_Change()
    Debug.Print "Date selected: " & Format(DTPicker1.Value, "ddmmyyyy")
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
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