Private Sub CommandButton_SaveData_Click()
Dim I As Long, Plage As Range, Ligne As Long, Nom As String
With Sheets("Feuil1")
Set Plage = .Range("B1", .Cells(.Rows.Count, 2).End(xlUp))
End With
With Sheets("DataBase Application")
If IsNumeric(Application.Match(CLng(Me.TextBox_EquipementSAP.Text), .[A:A], 0)) Then
Ligne = Application.Match(CLng(Me.TextBox_EquipementSAP.Text), .[A:A], 0)
Else
Ligne = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
End If
For I = 1 To 96
Nom = Plage(I).Offset(, 1)
If Nom <> "" Then
If TypeName(Me.Controls(Nom)) = "CheckBox" Then
If Me.Controls(Nom).Value = True Then
.Cells(Ligne, I) = "YES"
End If
Else
.Cells(Ligne, I) = Me.Controls(Nom).Value
End If
End If
Next I
End With
End Sub