Reversed date

Solved
abdellah_tadjine Posted messages 203 Status Membre -  
ccm81 Posted messages 11033 Status Membre -
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

3 réponses

madmyke Posted messages 52304 Registration date   Status Modérateur Last intervention   12 483
 
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."
0
abdellah_tadjine Posted messages 203 Status Membre 6
 
thank you anyway,
0
Anonymous user
 
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
0
ccm81 Posted messages 11033 Status Membre 2 434
 
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
0