I am doing a form and I am finding myself with a weird problem with the TextBox.
I ask the user to insert some data and when it does, the TextBox changes the data.
An example, if the user inserts: 03/01/2013 and then the runs the form, the form instead to perform the code with the original data changes it, 01/03/2013.
I realized that always changes the day and the month, but never the year.
Extra information, I never "told" the form that the data it is gonna process it is a date.
I am struggling to make it work it out, so any help will be grateful.
If extra info is needed, please let me know it.
Code:
Private Sub CommandButton1_Click()
ThisWorkbook.Sheets("Hidden").Range("D1").Value = TextBox1.Value
ThisWorkbook.Sheets("Hidden").Range("D2").Value = TextBox2.Value
If TextBox1.Value < TextBox2.Value Then
If TextBox1.Value = "" Or TextBox2.Value = "" Then
MsgBox "...", vbExclamation, " ..."
Else
Run "macro"
ThisWorkbook.Sheets("SUMUP").Range("D11").Value = TextBox1.Value
ThisWorkbook.Sheets("SUMUP").Range("D12").Value = TextBox2.Value
End If
Else
MsgBox "..." & vbCrLf & "...", vbExclamation, " ..."
End If
End Sub
Thanks.