Dim p As MSForms.Page, c As Control, i As Integer, X As Long, T() As Variant
For Each p In Me.MultiPage_KE.Pages
For Each c In Me.MultiPage_KE.Pages(p.Name).Controls
If TypeName(c) = "CheckBox" Then
If c.Value = True Then
i = i + 1
ReDim Preserve T(1 To i)
T(i) = c.Caption
End If
End If
Next c
Next p
If i = 0 Then
Call MsgBox("Vous n'avez coché aucun system defects", vbExclamation, Application.Name)
ElseIf i > 4 Then Call MsgBox("Vous avez coché plus de 4 system defects", vbExclamation, Application.Name)
Else:
X = Columns(21).Find("", Cells(Rows.Count, 21), xlValues, , 1, 1, 0).Row
Cells(X, 21).Resize(1, Columns.Count - 20).Find("", Cells(X, Columns.Count), xlValues, , 2, 1, 0).Resize(1, UBound(T)).Value = T
Unload Me: reporter_un_incident_part3.Show
End If