1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const num As Long = 1 ' n° de la MFC si plusieurs à gérer sinon utiliser =VRAI en formule
suppMFC ActiveSheet, 1
With Target.EntireRow
.FormatConditions.Add Type:=xlExpression, Formula1:="=" & num & "=" & num
.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With .FormatConditions(1).Interior
.Color = 65535
End With
.FormatConditions(1).StopIfTrue = True
End With
End Sub
Sub suppMFC(sh As Worksheet, num As Long)
Dim fc As FormatCondition
For Each fc In sh.Cells.FormatConditions
If fc.Formula1 = "=" & num & "=" & num Then fc.Delete
Next fc
End Sub |
Partager