Hello experts,
I have a userform with several date text boxes. I added the text "dd/mm/yyyy" to the text box, so that user will enter the date in that format, but when the date is entered to the excel sheet, the date is displayed in the format of "mm/dd/yyyy". When the user enters 2nd of March in 2020 (02/03/2020), it will display in the sheet as 3rd of February 2020 (03/02/2020). I tried to change the format of the column to Short Date format (dd/mm/yyyy), but still the date is displayed in the "mm/dd/yyyy" format. Is there a way to change this? I found the below code from a thread, but couldn't change it to match my need. Any help from you is highly appreciated.
This is my code to enter the date into the excel sheet after clicking the submit button of the userform.
Thanks a lot in advance
I have a userform with several date text boxes. I added the text "dd/mm/yyyy" to the text box, so that user will enter the date in that format, but when the date is entered to the excel sheet, the date is displayed in the format of "mm/dd/yyyy". When the user enters 2nd of March in 2020 (02/03/2020), it will display in the sheet as 3rd of February 2020 (03/02/2020). I tried to change the format of the column to Short Date format (dd/mm/yyyy), but still the date is displayed in the "mm/dd/yyyy" format. Is there a way to change this? I found the below code from a thread, but couldn't change it to match my need. Any help from you is highly appreciated.
VBA Code:
Cells(endRow, 1) = DateValue(Format(TextBox1.Value, "dd/mm/yyyy"))
This is my code to enter the date into the excel sheet after clicking the submit button of the userform.
VBA Code:
wsServiceRegistry.Cells(emptyRow, 2).Value = ServiceDateTextBox.Value
Thanks a lot in advance