How to use datepicker with custom format

  • Hello I'm try to get from the user the date and time at the same datepicker so I try to do 21/06/2019 23:38 this format(dd/MM/yyyy hh:mm)

    I use with Microsoft Date and Time Picker control version 6.0

    public Sub bTNOK_Click()
    Cells(1,1).Value = Format(DTPicker1.Value, "dd/MM/yyyy hh:mm")
    End Sub
    public Sub UserForm_Initialize()
    With DTPicker1
    .Format = dtpCustom
    .CustomFormat = "dd/MM/yyyy hh:mm"
    End With
    End Sub [/VBA]
    on the properties of datepicker

    CustomFormat ["dd/MM/yyyy hh:mm"]

    Format [3 - dtpCustom)

    Value [21/06/2019]

    when I run this the Value of cell 1,1 is "30/12/1889 00:00" so how can I fix it?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!