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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
| Private Sub Worksheet_Change(ByVal Target As Range)
If Range("B9").Value <= 0 And Range("B9").Value >= -5 And Range("B10").Value = 5 Then 'Pour T°consigne entre (-5;0) et DKevap =5
If Target.Address = Range("B9").Address Then
Run ("negatifCinq") 'Pour T°consigne entre (-5;0) et DKevap =5 quand on agit sur B9 (T°consigne)
ElseIf Target.Address = Range("B10").Address Then
Run ("negatifCinq") 'Pour T°consigne entre (-5;0) et DKevap =5 quand on agit sur B10 (DK Evap)
End If
ElseIf Range("B9").Value <= 0 And Range("B9").Value >= -5 And Range("B10").Value = 6 Then
If Target.Address = Range("B9").Address Then
Run ("negatifSix") 'Pour T°consigne entre (-5;0) et DKevap =6 quand on agit sur B9 (T°consigne)
ElseIf Target.Address = Range("B10").Address Then
Run ("negatifSix") 'Pour T°consigne entre (-5;0) et DKevap =6 quand on agit sur B10 (DK Evap)
End If
ElseIf Range("B9").Value <= 0 And Range("B9").Value >= -5 And Range("B10").Value = 7 Then
If Target.Address = Range("B9").Address Then
Run ("negatifSept") 'Pour T°consigne entre (-5;0) et DKevap =7 quand on agit sur B9 (T°consigne)
ElseIf Target.Address = Range("B10").Address Then
Run ("negatifSept") 'Pour T°consigne entre (-5;0) et DKevap =7 quand on agit sur B10 (DK Evap)
End If
ElseIf Range("B9").Value <= 0 And Range("B9").Value >= -5 And Range("B10").Value = 8 Then
If Target.Address = Range("B9").Address Then
Run ("negatifHuit") 'Pour T°consigne entre (-5;0) et DKevap =8 quand on agit sur B9 (T°consigne)
ElseIf Target.Address = Range("B10").Address Then
Run ("negatifHuit") 'Pour T°consigne entre (-5;0) et DKevap =8 quand on agit sur B10 (DK Evap)
End If
ElseIf Range("B9").Value <= 0 And Range("B9").Value >= -5 And Range("B10").Value = 9 Then
If Target.Address = Range("B9").Address Then
Run ("negatifNeuf") 'Pour T°consigne entre (-5;0) et DKevap =9 quand on agit sur B9 (T°consigne)
ElseIf Target.Address = Range("B10").Address Then
Run ("negatifNeuf") 'Pour T°consigne entre (-5;0) et DKevap =9 quand on agit sur B10 (DK Evap)
End If
ElseIf Range("B9").Value <= 0 And Range("B9").Value >= -5 And Range("B10").Value = 10 Then
If Target.Address = Range("B9").Address Then
Run ("negatifDix") 'Pour T°consigne entre (-5;0) et DKevap =10 quand on agit sur B9 (T°consigne)
ElseIf Target.Address = Range("B10").Address Then
Run ("negatifDix") 'Pour T°consigne entre (-5;0) et DKevap =10 quand on agit sur B10 (DK Evap)
End If
ElseIf Range("B9").Value <= 0 And Range("B9").Value >= -5 And Range("B10").Value = 11 Then
If Target.Address = Range("B9").Address Then
Run ("negatifOnze") 'Pour T°consigne entre (-5;0) et DKevap =11 quand on agit sur B9 (T°consigne)
ElseIf Target.Address = Range("B10").Address Then
Run ("negatifOnze") 'Pour T°consigne entre (-5;0) et DKevap =11 quand on agit sur B10 (DK Evap)
End If
ElseIf Range("B9").Value <= 0 And Range("B9").Value >= -5 And Range("B10").Value = 12 Then
If Target.Address = Range("B9").Address Then
Run ("negatifDouze") 'Pour T°consigne entre (-5;0) et DKevap =12 quand on agit sur B9 (T°consigne)
ElseIf Target.Address = Range("B10").Address Then
Run ("negatifDouze") 'Pour T°consigne entre (-5;0) et DKevap =12 quand on agit sur B10 (DK Evap)
End If
ElseIf Range("B9").Value <= 0 And Range("B9").Value >= -5 And Range("B10").Value = 13 Then
If Target.Address = Range("B9").Address Then
Run ("negatifTreize") 'Pour T°consigne entre (-5;0) et DKevap =13 quand on agit sur B9 (T°consigne)
ElseIf Target.Address = Range("B10").Address Then
Run ("negatifTreize") 'Pour T°consigne entre (-5;0) et DKevap =13 quand on agit sur B10 (DK Evap)
End If
ElseIf Range("B9").Value <= 0 And Range("B9").Value >= -5 And Range("B10").Value = 14 Then
If Target.Address = Range("B9").Address Then
Run ("negatifQuatorze") 'Pour T°consigne entre (-5;0) et DKevap =14 quand on agit sur B9 (T°consigne)
ElseIf Target.Address = Range("B10").Address Then
Run ("negatifQuatorze") 'Pour T°consigne entre (-5;0) et DKevap =14 quand on agit sur B10 (DK Evap)
End If
ElseIf Range("B9").Value <= 0 And Range("B9").Value >= -5 And Range("B10").Value = 15 Then
If Target.Address = Range("B9").Address Then
Run ("negatifQuinze") 'Pour T°consigne entre (-5;0) et DKevap =15 quand on agit sur B9 (T°consigne)
ElseIf Target.Address = Range("B10").Address Then
Run ("negatifQuinze") 'Pour T°consigne entre (-5;0) et DKevap =1 quand on agit sur B10 (DK Evap)
End If
ElseIf Range("B9").Value <= 5 And Range("B9").Value >= 0 And Range("B10").Value = 5 Then
If Target.Address = Range("B9").Address Then
Run ("NulCinq") 'Pour T°consigne entre (0;5) et DKevap =5 quand on agit sur B9 (T°consigne)
ElseIf Target.Address = Range("B10").Address Then
Run ("NulCinq") 'Pour T°consigne entre (0;5) et DKevap =5 quand on agit sur B10 (DK Evap)
End If
ElseIf Range("B9").Value <= 5 And Range("B9").Value >= 0 And Range("B10").Value = 6 Then
If Target.Address = Range("B9").Address Then
Run ("NulSix") 'Pour T°consigne entre (0;5) et DKevap =6 quand on agit sur B9 (T°consigne)
ElseIf Target.Address = Range("B10").Address Then
Run ("NulSix") 'Pour T°consigne entre (0;5) et DKevap = 5 quand on agit sur B10 (DK Evap)
End If
End If
End Sub
Je vous joint également le code d'un module type car ils sont très répétitifs, ce ne sont également que les emplacements des cellules qui diffèrent.
Sub NegatifSix()
Dim eFormule
eFormule = Range("P5").Value + (-Range("B9").Value + Range("P3").Value) * ((Range("Q5").Value - Range("P5").Value) / (Range("Q3").Value + Range("P3").Value))
Range("L5") = eFormule
End Sub |
Partager