Reversed date
Solved
abdellah_tadjine
Posted messages
203
Status
Member
-
ccm81 Posted messages 11033 Status Member -
ccm81 Posted messages 11033 Status Member -
Hello,
I created an application in userform to manage a small database, everything works very well except when I type the date in the textbox, I find it inverted in my Excel sheet
for example, I type 03/09/2017 in the textbox but it writes 09/03/2017 in the sheet, thank you for giving me an explanation to solve this problem.
Configuration: Windows / Chrome 59.0.3071.115
I created an application in userform to manage a small database, everything works very well except when I type the date in the textbox, I find it inverted in my Excel sheet
for example, I type 03/09/2017 in the textbox but it writes 09/03/2017 in the sheet, thank you for giving me an explanation to solve this problem.
Configuration: Windows / Chrome 59.0.3071.115
3 answers
-
Hello
Excel displays dates based on the "regional settings"; you should first check these in the control panel.
If they are correct, then it's because Excel does not recognize the date format from your file.
Since this comes from a text format, that's probably the issue.
Apart from forcing the Excel column to date format, I don't see any solution.
This is quite a common problem when importing into Excel.
Best regards
--
"We swallow the flattering lie in great gulps and sip the bitter truth drop by drop." -
Good evening,
how do you pass the value of your textbox to the cell?
--
When I was little, the Dead Sea was only sick.
George Burns -
Hello
Try this
Private Sub CommandButton1_Click()
Dim dt As String, d As Date
dt = Me.TextBox1.Text
d = CDate(dt)
Range("A1").Value = d
End Sub
cdlmnt