1 2 3 4 5 6 7 8 9 10 11 12 13 14
| Private Sub UserForm_Click()
TextBox1.Value = Format(Date, "dd mmm yyyy")
ladate = DateValue(TextBox1.Value)'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
TextBox2 = DateValue(TextBox1.Value)
MsgBox Month(ladate)
' sans formatage il y aura donc les separator en fonction de votre system( / ou - ou autre)
Cells(1, 1).Value = DateSerial(Year(ladate), Month(ladate), Day(ladate)) ' ici tu aura la date en format de ta region paramétrée dans ton systeme
Cells(2, 1).NumberFormat = "mm dd yyyy" 'format US sans separator
Cells(2, 1).Value = DateSerial(Year(ladate), Month(ladate), Day(ladate))
Cells(3, 1).NumberFormat = "yyyy mm dd" 'format canadien sans separator
Cells(3, 1).Value = DateSerial(Year(ladate), Month(ladate), Day(ladate))
End Sub |