Problème de formule dans une macro VBA

Résolu
Dautomne Messages postés 20 Date d'inscription   Statut Membre Dernière intervention   -  
Dautomne Messages postés 20 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour à tous,

Je n'arrive pas à écrire en langage VBA la formule suivante "=SI(NB.SI(D54:D56;""OUI"")<>3;""couleur -->0.249946592608417")".

Pourriez vous m'aider?

Je vous remercie par avance :-)


Sub Macro13()
'
'SOUS-TRAITANCE
       
  Range("G5").Select
    Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .ThemeColor = xlThemeColorAccent6
        .TintAndShade = -0.249946592608417
    End With

End Sub





Configuration: Windows / Firefox 78.0
A voir également:

1 réponse

pijaku Messages postés 12263 Date d'inscription   Statut Modérateur Dernière intervention   2 759
 
Bonjour,

Peut-être comme ceci :
Sub Macro13()
'
'SOUS-TRAITANCE
       
    Range("G5").FormatConditions.Add Type:=xlExpression, Formula1:="=NB.SI(D54:D56;""OUI"")<>3"
    Range("G5").FormatConditions(Range("G5").FormatConditions.Count).SetFirstPriority
    With Range("G5").FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .ThemeColor = xlThemeColorAccent6
        .TintAndShade = -0.249946592608417
    End With

End Sub

Sinon, expliquez avec des mots ce que vous souhaitez...
0
Dautomne Messages postés 20 Date d'inscription   Statut Membre Dernière intervention  
 
Merci pour ton aide la macro fonctionne :-).
0