Bonjour à tous,
Je me permets de vous écrire car j'ai un problème avec ma macro.
Je souhaite mettre une couleur différente pour les cellules sous.total étant supérieur à un seuil, sauf qu'elle ne fonctionne qu'une fois sur deux.
Merci pour votre aide.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 Sub test() Dim Cell As Range irow = Worksheets("Quid").Cells(Rows.Count, 1).End(xlUp).Row For Each Cell In Range("N1:N" & irow) If Cell.HasFormula And InStr(1, Cell.Formula, "SOUS.TOTAL", vbTextCompare) > 0 Then Cell.Interior.ColorIndex = 6 End If Next End Sub
Partager