Transformer une MACRO "Colorier"

olibelle0101

XLDnaute Occasionnel
Bonsoir,
j'ai trouvé une formule qui marche très bien...
Mais je rajoute une colonne avec une autre couleur...
Il me faudrait transformer ce code, mais j'ai trop de mal...
Si vous pouvez m'aider, ça serait sympa.
Je rajoute ce petit fichier...
Et Merci VDAVID qui est à l'origine de la trouvaille...
 

Pièces jointes

  • ColorVBA.xlsm
    42.6 KB · Affichages: 41
  • ColorVBA.xlsm
    42.6 KB · Affichages: 41
  • ColorVBA.xlsm
    42.6 KB · Affichages: 31
Dernière édition:

olibelle0101

XLDnaute Occasionnel
Re : Transformer une VBA trouvé ici...

BONSOIR

j'ai trouvé ce magnifique code par VDAVID
Le calcul ce fait sur la colonne D...
mais je voudrai transformer ce code, pour qu'il me calcule de D à AA
Comment faire cette transformation de code...
Merci encore...
 

Pièces jointes

  • ColorVBA.xlsm
    70.7 KB · Affichages: 44
  • ColorVBA.xlsm
    70.7 KB · Affichages: 42
  • ColorVBA.xlsm
    70.7 KB · Affichages: 38

olibelle0101

XLDnaute Occasionnel
Re : Transformer une MACRO "Colorier"

Voici mon code : Il est valable pour la colonne "D" et marche très bien...
Mais je voudrai qu'il prenne en compte d'autres colonnes de ""D:AA"



Sub Colorier()

Dim Ws As Worksheet
Dim i As Integer

Set Ws = Sheets("Saisie")
With Ws

.Range("D1:D" & .Range("D65536").End(xlUp).Row).Interior.ColorIndex = xlNone
For i = 1 To .Range("D65536").End(xlUp).Row

If .Range("D" & i).Value <> "" Then

If .Range("D" & i).Value = .Range("AC" & i).Value Or .Range("D" & i).Value = .Range("AD" & i).Value Then

.Range("D" & i).Interior.ColorIndex = 6

End If

If .Range("D" & i).Value = .Range("AE" & i).Value Or .Range("D" & i).Value = .Range("AF" & i).Value Then

.Range("D" & i).Interior.ColorIndex = 20

End If

If .Range("D" & i).Value = .Range("AG" & i).Value Or .Range("D" & i).Value = .Range("AH" & i).Value Then

.Range("D" & i).Interior.ColorIndex = 25

End If
End If

Next i

End With
End Sub
 
Dernière édition:

Discussions similaires

Réponses
2
Affichages
281

Statistiques des forums

Discussions
312 191
Messages
2 086 051
Membres
103 108
dernier inscrit
Captain NRJ