Bonjour le forum,
Comme simplifier ce code (j'ai 50X les mêmes lignes) :
If ActiveCell = TextBox1 And CheckBox1 = True Then
ActiveCell.EntireRow.Delete Shift:=xlUp
Else
ActiveCell.Offset(1, 0).Activate
End If
If ActiveCell = TextBox2 And CheckBox2 = True Then
ActiveCell.EntireRow.Delete Shift:=xlUp
Else
ActiveCell.Offset(1, 0).Activate
End If
If ActiveCell = TextBox3 And CheckBox3 = True Then
ActiveCell.EntireRow.Delete Shift:=xlUp
Else
ActiveCell.Offset(1, 0).Activate
End If
If ActiveCell = TextBox4 And CheckBox4 = True Then
ActiveCell.EntireRow.Delete Shift:=xlUp
Else
ActiveCell.Offset(1, 0).Activate
End If
Merci de votre aide.
Comme simplifier ce code (j'ai 50X les mêmes lignes) :
If ActiveCell = TextBox1 And CheckBox1 = True Then
ActiveCell.EntireRow.Delete Shift:=xlUp
Else
ActiveCell.Offset(1, 0).Activate
End If
If ActiveCell = TextBox2 And CheckBox2 = True Then
ActiveCell.EntireRow.Delete Shift:=xlUp
Else
ActiveCell.Offset(1, 0).Activate
End If
If ActiveCell = TextBox3 And CheckBox3 = True Then
ActiveCell.EntireRow.Delete Shift:=xlUp
Else
ActiveCell.Offset(1, 0).Activate
End If
If ActiveCell = TextBox4 And CheckBox4 = True Then
ActiveCell.EntireRow.Delete Shift:=xlUp
Else
ActiveCell.Offset(1, 0).Activate
End If
Merci de votre aide.