VBA Date Format English/French

Solved
Varin -  
pijaku Posted messages 13513 Registration date   Status Moderator Last intervention   -
Hello,

I would like to display a date input box in the format "dd/mm/yyyy".

When the user enters the date in the specified format, this date is displayed in the file in the format "mm/dd/yyyy".

-----------------------------------------------------------------------------------------
ActiveCell.FormulaR1C1 = InputBox("Enter the Date in the format dd/mm/yyyy")
Selection.NumberFormat = "dd/mm/yyyy"
-----------------------------------------------------------------------------------------

Do you have any ideas to help me? Thank you in advance.

4 answers

  1. pijaku Posted messages 13513 Registration date   Status Moderator Last intervention   2 773
     
    Hello,

    Try this:
    Sub test() Dim myDate As Date, strDate As String strDate = InputBox("Enter the Date in the format dd/mm/yyyy") myDate = CDate(strDate) ActiveCell.Value2 = myDate End Sub


    --
    Before, I never managed to finish my sentences... but now I
    1