Bonjour,
J'ai créer un formulaire dans un Userform qui renvoi une fois valider des données dans un tableaux. Cependant, on peux imaginer que les utlisateur des formulaires ne resecterons pas le format de date attendu c'est à dire jj/mm/aaaa. Idem pour l'heure, je y mettre un code qui retranscrive directment dans le formulaire le format voulu.
Private Sub UserForm_Initialize()
Merci
J'ai créer un formulaire dans un Userform qui renvoi une fois valider des données dans un tableaux. Cependant, on peux imaginer que les utlisateur des formulaires ne resecterons pas le format de date attendu c'est à dire jj/mm/aaaa. Idem pour l'heure, je y mettre un code qui retranscrive directment dans le formulaire le format voulu.
Code:
Private Sub CheckBox1_Click()
Range("O2").Value = IIf(CheckBox1, "X", "")
End Sub
Code:
Private Sub CommandButton1_Click()
Dim ligne As Integer
ligne = ActiveCell.Row
Range("B2").Select
'If Len(Sheets("SYNTHESE_AUTRES").Cells(ligne, 2))= Then
If Range("B2").Value = "" Then
ligne = Range("SYNTHESE_AUTRES!B65500").End(xlUp).Row + 1
Else
ligne = Range("SYNTHESE_AUTRES!B65500").End(xlUp).Row + 1
End If
Sheets("SYNTHESE_AUTRES").Cells(ligne, 1) = ligne
'End If
Sheets("SYNTHESE_AUTRES").Cells(ligne, 2) = Format(TextBox1, "2_2010_0000")
Sheets("SYNTHESE_AUTRES").Cells(ligne, 3) = Format(TextBox2, "mm/dd/yyyy")
Sheets("SYNTHESE_AUTRES").Cells(ligne, 4) = ComboBox1.Value
Sheets("SYNTHESE_AUTRES").Cells(ligne, 5) = ComboBox2.Value
Sheets("SYNTHESE_AUTRES").Cells(ligne, 12) = Format(TextBox4, "dd/mm/yyyy")
Sheets("SYNTHESE_AUTRES").Cells(ligne, 13) = Format(TextBox5, "hh:mm")
Sheets("SYNTHESE_AUTRES").Cells(ligne, 11) = ComboBox3.Value
Sheets("SYNTHESE_AUTRES").Cells(ligne, 10) = ComboBox4.Value
Sheets("SYNTHESE_AUTRES").Cells(ligne, 14) = TextBox6.Value
ComboBox1 = "Sélectionnez votre service"
ComboBox2 = "Sélectionnez le type de transport"
ComboBox3 = "Sélectionnez le lieu de RDV"
ComboBox4 = "Sélectionnez le motif"
TextBox1 = Format(TextBox1, "2_2010_0000")
TextBox2 = ""
TextBox4 = ""
TextBox5 = ""
TextBox6 = ""
confirmation2.Show
End Sub
Code:
Dim Dline As Integer
Dline = Range("SYNTHESE_AUTRES!B20000").End(xlUp).Row
TextBox1.Value = Dline
TextBox2.Value = Date
ComboBox1.ColumnCount = 1
ComboBox2.ColumnCount = 1
ComboBox3.ColumnCount = 1
ComboBox4.ColumnCount = 1
With ThisWorkbook.Worksheets("UF (2)")
For I = 4 To .Range("D65536").End(xlUp).Row
autresdemandes.ComboBox1.AddItem .Range("D" & I).Value
Next I
End With
With ThisWorkbook.Worksheets("TYPE DU TRANSPORTS")
For I = 3 To .Range("C65536").End(xlUp).Row
autresdemandes.ComboBox2.AddItem .Range("C" & I).Value
Next I
End With
With ThisWorkbook.Worksheets("MOTIF")
For I = 3 To .Range("C65536").End(xlUp).Row
autresdemandes.ComboBox4.AddItem .Range("C" & I).Value
Next I
End With
With ThisWorkbook.Worksheets("LIEUX DE RDV")
For I = 3 To .Range("C65536").End(xlUp).Row
autresdemandes.ComboBox3.AddItem .Range("C" & I).Value
Next I
End With
End Sub
Code:
Private Sub CommandButton2_Click()
anuleoperation2.Show
End Sub
Merci