I have a custom display in my worksheet for showing the date in dddd, dd, mmmm, yyyy format and want to display the same format in a corresonding User Form. The input value is displayed in UK format so today is 10/06/22 in the cells and displays as Friday, 10, June, 2022.
I have the following Module in my user form which should take the value in the ws cell and return the custom format in the textbox.
Which works fine when the DAY value is greater than 12.
28/05/2022 displays as Saturday, 28, May, 2022
When the DAY value is 12 or less, then the date is diplayed in US format
09/06/2022 appears as Thursday, 09, June, 2022 in my worksheet but as Tuesday, 06, Septermber, 2022 in the User Form
Any ideas how I should chnage the format in the textbox so the UK date format is displayed as in my worksheet.
I have the following Module in my user form which should take the value in the ws cell and return the custom format in the textbox.
VBA Code:
Private Sub txtDate_Change()
If IsDate(Me.txtDate.Text) Then
Me.txtDate.Text = Format(Me.txtDate.Text, "dddd, dd, mmmm, yyyy")
End If
End Sub
Which works fine when the DAY value is greater than 12.
28/05/2022 displays as Saturday, 28, May, 2022
When the DAY value is 12 or less, then the date is diplayed in US format
09/06/2022 appears as Thursday, 09, June, 2022 in my worksheet but as Tuesday, 06, Septermber, 2022 in the User Form
Any ideas how I should chnage the format in the textbox so the UK date format is displayed as in my worksheet.