bonjour,
j ai une textbox qui affiche la date du jour à l'initialisation du formulaire
Private Sub UserForm_Initialize()
'Affichage de la date du jour
TextBox1.Text = CStr(Date)
Cette date est alors reportée dans un tableau excel par validation du formulaire mais pour une date au format 01/09/2015 dans la textbox , le format qui s'affiche dans le tableau excel est 09/01/2015
Merci pour votre aide
Private Sub Enregistrement_Click()
'Valider et stocker
Application.ScreenUpdating = False
Dim Ctrl As Control
Dim Rep As Integer
Dim r As Integer
If TextBox1 = "" Or TextBox2 = "" Or TextBox3 = "" Or TextBox4 = "" Or TextBox5 = "" Or TextBox6 = "" Or TextBox7 = "" Then
MsgBox (" Tous les champs doivent être renseignés !"), vbRetryCancel
If Rep = vbRetry Then
Unload Me
End If
Else
If Rep = vbCancel Then
Unload Me
End If
With Sheets("Suivi_Jour")
Range("B1") = ComboBox1.Text
Range("A" & Rows.Count).End(xlUp).Offset(1, 0) = Me.TextBox1 & IIf(IsNumeric(TextBox1), " ", "")
Range("B" & Rows.Count).End(xlUp).Offset(1, 0) = Me.TextBox2 & IIf(IsNumeric(TextBox2), " ", "")
Range("C" & Rows.Count).End(xlUp).Offset(1, 0) = Me.TextBox3 & IIf(IsNumeric(TextBox3), " ", "")
Range("D" & Rows.Count).End(xlUp).Offset(1, 0) = Me.TextBox4 & IIf(IsNumeric(TextBox4), " ", "")
Range("E" & Rows.Count).End(xlUp).Offset(1, 0) = Me.TextBox5 & IIf(IsNumeric(TextBox5), " ", "")
Range("I" & Rows.Count).End(xlUp).Offset(1, 0) = Me.TextBox6 & IIf(IsNumeric(TextBox6), " ", "")
Range("J" & Rows.Count).End(xlUp).Offset(1, 0) = Me.TextBox7 & IIf(IsNumeric(TextBox7), " ", "")
For Each Ctrl In Saisies.Controls
Next
Unload Me
Sheets("Suivi_Jour").Visible = xlVeryHidden
Sheets("Synthèse").Visible = xlSheetVisible
Sheets("Synthèse").Select
Application.ScreenUpdating = True
End With
End If
End Sub