Checkbox

Antho35

XLDnaute Occasionnel
Bonjour,

J'ai un formulaire avec notament dedan une checkbox, je voudrais que cette derniére si elle est coché'renvoi au même titre que les autres données , une info dans mon tableau par exem^ple si coché mettre X dans le tableau.

Merci.
 

Antho35

XLDnaute Occasionnel
Re : Checkbox

Voici le code de mon usf, le tableau qui recoit les résultat s'appelle SYNTHESE_AUTRES.

Code:
[QUOTE][/QUOTE]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, "dd/mm/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:
Private Sub UserForm_Initialize()
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[QUOTE][/QUOTE]
 

Pierrot93

XLDnaute Barbatruc
Re : Checkbox

Bonjour Antho, Jean-Marcel

tu veux mettre le résultat où ? sur la première cellule vide après la dernière cellule utilisée d'une colonne ? si c'est le cas, modifie ainsi :

Code:
Range("A65536").End(xlUp)(2).Value = IIf(CheckBox1, "X", "")

bonne journée
@+
 

Antho35

XLDnaute Occasionnel
Re : Checkbox

Ce code soit aliminenter un tableau. Le tableau contiient les résultat de plusieurs entregristrement de formumalire. Le résuktat du "cohcgae"va en colone o, premiére ligne 2.

J'ai bien évidemenent remplacer ton a, par mon o
 

Pierrot93

XLDnaute Barbatruc
Re : Checkbox

Re,

si c'est bien la feuille active et si tu n'as pas de cellules fusionnées devrait fonctionner, mais attention si décoché la cellule ne sera pas valorisée, et c'est cette même cellule qui sera renseignée par un X lors du prochain click...

le code est bien dans le module du usf ?
 

Discussions similaires

Statistiques des forums

Discussions
312 299
Messages
2 086 986
Membres
103 419
dernier inscrit
mk29