1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| Private Sub btn_creer_Click()
Dim i As Integer
i = 11
Do While (Sheets("Participants").Cells(6, i).Value <> "")
i = i + 1
Loop
Sheets("Participants").Cells(6, i).Value=UserFormChantier.txt_session.Value
Dim DLV As Long
DLV = Range("B65536").End(xlUp).Row
Dim k As Integer
Dim nCheckTopPosition As Integer
Dim nLabelTopPosition As Integer
nCheckTopPosition = 15
nLabelTopPosition = 18
For nControlIndex = 1 To DLV
Dim chkBox As Control
Set chkBox = Me.Controls.Add("Forms.CheckBox.1", "chkCheck" & DLV, True)
chkBox.Left = 100
chkBox.Top = nCheckTopPosition
nCheckTopPosition = nCheckTopPosition + 20
Dim lblLab As Control
Set lblLab = Me.Controls.Add("Forms.Label.1", "lblCheck" & DLV, True)
lblLab.Left = 115
lblLab.Top = nLabelTopPosition
nLabelTopPosition = nLabelTopPosition + 20
For k = 7 To DLV
lblLab.Caption = Sheets("Participants").Cells(k, 4).Value & Sheets("Participants").Cells(k, 5).Value
' colonne4=nom, colonne5= prenom
Exit For
Next k
Next
End Sub |
Partager