how to debug.print datepicker value

Pookiemeister

Active Member
Joined
Nov 26, 2015
Messages
306
Office Version
  1. 365
  2. 2010
As the title states, how do I get the value of the date picker by debug.print.

Thank you
 

Some videos you may like

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,343
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:

Pookiemeister

Active Member
Joined
Nov 26, 2015
Messages
306
Office Version
  1. 365
  2. 2010
Now I am wondering? Is it possible to format a DTPicker value without the forward slashes? i.e. 03122019 or 3122019. Thank You.
 

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,343
Code:
Private Sub DTPicker1_Change()
    Debug.Print "Date selected: " & Format(DTPicker1.Value, "ddmmyyyy")
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,109,378
Messages
5,528,341
Members
409,817
Latest member
JiNXX9500

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top