[Catégorie modifiée .Net - VBA] Erreur d'exécution '13':incompatibilité de type
argaz01
Messages postés37Date d'inscriptionlundi 12 janvier 2009StatutMembreDernière intervention10 avril 2012
-
18 juin 2010 à 15:15
cs_Jack
Messages postés14006Date d'inscriptionsamedi 29 décembre 2001StatutModérateurDernière intervention28 août 2015
-
18 juin 2010 à 19:14
Bonjour,
Le code suivant m'affiche une erreurd'exécution '13': incompatibilité de type. Merci d'y jeter un coup d'oeil et de m'éclairer.
Sub coul()
Dim c As Range, FC As FormatCondition, F1, x As Long
Application.ScreenUpdating = False
x = 0
For Each c In [P8:P128] 'plage a definir
c.Activate
For Each FC In ActiveCell.FormatConditions
If FC.Type = xlCellValue Then
F1 = Evaluate(FC.Formula1)
Select Case FC.Operator
Case xlBetween: If ActiveCell >= F1 _
And ActiveCell <= Evaluate(FC.Formula2) Then Exit For
Case xlEqual: If ActiveCell = F1 Then Exit For
Case xlGreater: If ActiveCell > F1 Then Exit For
Case xlGreaterEqual: If ActiveCell >= F1 Then Exit For
Case xlLess: If ActiveCell < F1 Then Exit For
Case xlLessEqual: If ActiveCell <= F1 Then Exit For
Case xlNotBetween: If ActiveCell < F1 _
Or ActiveCell > Evaluate(FC.Formula2) Then Exit For
Case xlNotEqual: If ActiveCell <> F1 Then Exit For
End Select
Else
If Evaluate(FC.Formula1) Then Exit For
End If
Next FC
If Not FC Is Nothing Then
If FC.Interior.ColorIndex 3 Then x x + 1 'index couleur= 3 rouge
End If
Next c
MsgBox x 'variable a utiliser
End Sub
A voir également:
[Catégorie modifiée .Net - VBA] Erreur d'exécution '13':incompatibilité de type