Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim ac%, rc&, rc1&, rc2&, cc%, cc1%, cc2%, i%, j%
Dim a1 As Range, a2 As Range, ref As Range, inter As Range, sel As Range
ac = Target.Areas.Count: rc = Rows.Count: cc = Columns.Count
For i = 1 To ac - 1
Set a1 = Target.Areas(i)
rc1 = a1.Rows.Count: cc1 = a1.Columns.Count
For j = i + 1 To ac
Set a2 = Target.Areas(j)
rc2 = a2.Rows.Count: cc2 = a2.Columns.Count
If rc1 = 1 And cc1 = cc And rc2 = rc And cc2 = 1 Or _
rc1 = rc And cc1 = 1 And rc2 = 1 And cc2 = cc Then
Set ref = Intersect(a1, a2)
Set inter = Union(IIf(inter Is Nothing, ref, inter), ref)
Set sel = Union(IIf(sel Is Nothing, a1, sel), a1, a2)
End If
Next
Next
Application.ScreenUpdating = False
Cells.FormatConditions.Delete
If inter Is Nothing Then Exit Sub
sel.FormatConditions.Add xlExpression, Formula1:=True
sel.FormatConditions(1).Interior.ColorIndex = 1 'noir
inter.FormatConditions.Delete
inter.FormatConditions.Add xlExpression, Formula1:=True
inter.FormatConditions(1).Interior.ColorIndex = 3 'rouge
End Sub