Problème de formule dans une macro VBA

Résolu
Dautomne Messages postés 21 Statut Membre -  
Dautomne Messages postés 21 Statut Membre -
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

1 réponse

  1. pijaku Messages postés 13513 Date d'inscription   Statut Modérateur Dernière intervention   2 772
     
    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
    1. Dautomne Messages postés 21 Statut Membre
       
      Merci pour ton aide la macro fonctionne :-).
      0