Bonjour le Forum,
Jaimerais un coup de pouce SVP: dans la macro ci-dessous, je souhaite que les calculs ne se fassent pas si j'efface plusieurs cellules en même temps. Auriez vous une idée?
Merci
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A3:A20,E3:E20")) Is Nothing Then
Application.EnableEvents = False
If Not IsNumeric(Target) Then
MsgBox "Saisissez une valeur numérique !", , "Attention"
Target.Select
'Exit Sub
Else
Target.Interior.ColorIndex = 4
Target.Offset(0, 1).FormulaR1C1 = "=RC[-1]*R2C"
Target.Offset(0, 1).Interior.ColorIndex = -4142
End If
Application.EnableEvents = True
Exit Sub
End If
If Not Application.Intersect(Target, Range("B3:B20,F3:F20")) Is Nothing Then
Application.EnableEvents = False
If Not IsNumeric(Target) Then
MsgBox "Saisissez une valeur numérique !", , "Attention"
Target.Select
'Exit Sub
Else
Target.Interior.ColorIndex = 4
Target.Offset(0, -1).FormulaR1C1 = "=RC[1]/R2C[1]"
Target.Offset(0, -1).Interior.ColorIndex = -4142
End If
Application.EnableEvents = True
Exit Sub
End If
'Next
End Sub