Problème compréhension VBA

jo1177

XLDnaute Junior
Bonjour le forum !
Voilà, j'ai un petit problème de compréhension d'une ligne de VBA.

Voici la macro :

Private Sub Worksheet_Calculate()
For lig = 2 To 4 Step 2
Set c = Cells(lig, 6)
If c.Value < 0.4 Then
c.Interior.ColorIndex = 3
c.Interior.Pattern = xlSolid
End If
'If [(MAX($C3:$E3)>$A2)*($F2<0.4)] Then
If Application.Max(c.Offset(, -3).Resize(1, 3).Offset(1)) > c.Offset(, -5).Value And c.Value < 0.4 Then
c.Interior.ColorIndex = 3
c.Interior.Pattern = xlUp
c.Interior.PatternColorIndex = xlAutomatic
End If
If c.Value > 0.4 And c.Value < 0.8 Then
c.Interior.ColorIndex = 8
c.Interior.Pattern = xlSolid
c.Interior.PatternColorIndex = xlAutomatic
End If
'If [=(MAX($C3:$E3)>$A2)*($F2>0.4)] Then
If Application.Max(c.Offset(, -3).Resize(1, 3).Offset(1)) > c.Offset(0, -5).Value And c.Value > 0.4 Then
c.Interior.ColorIndex = 8
c.Interior.Pattern = xlUp
c.Interior.PatternColorIndex = xlAutomatic
End If
If c.Value > 0.8 Then
c.Interior.ColorIndex = 4
c.Interior.Pattern = xlSolid
End If
'If [(MAX($C3:$E3)>$A2)*($F2>0.8)] Then
If Application.Max(c.Offset(, -3).Resize(1, 3).Offset(1)) > c.Offset(0, -5).Value And c.Value > 0.8 Then
c.Interior.ColorIndex = 4
c.Interior.Pattern = xlUp
c.Interior.PatternColorIndex = xlAutomatic
End If
Next lig
End Sub

Je ne comprend pas cette ligne :
If Application.Max(c.Offset(, -3).Resize(1, 3).Offset(1)) > c.Offset(0, -5).Value And c.Value > 0.8 Then
Je ne comprend pas le raisonnement. Pouvez vous m'expliquer plus en détail, sachant que je connais rien au VBA?! lol Je vous joint le fichier excel qui va avec pour plus de compréhension.
Merci !
Jonathan
 

Pièces jointes

  • MFCPlus3Expression2.zip
    15.6 KB · Affichages: 17
Dernière édition:

Discussions similaires

Réponses
4
Affichages
246
Réponses
4
Affichages
354
Réponses
3
Affichages
143

Membres actuellement en ligne

Statistiques des forums

Discussions
314 051
Messages
2 105 057
Membres
109 243
dernier inscrit
Erdnael