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

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
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,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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