Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim zone As Range
Cancel = True
If IsError([Sel]) Then Set zone = Target Else Set zone = [Sel]
Union(zone, Target.EntireRow, Target.EntireColumn).Name = "Sel"
If Target <> "" Then
If IsError([Inter]) Then Set zone = Target Else Set zone = [Inter]
Union(zone, Target).Name = "Inter"
End If
With [Sel]
Application.ScreenUpdating = False
.FormatConditions.Delete
.FormatConditions.Add xlExpression, Formula1:="=OU(LIGNE()=1;COLONNE()=28)"
.FormatConditions(1).Interior.ColorIndex = 3 'rouge
.FormatConditions(1).Font.ColorIndex = 2 'blanc
.FormatConditions(1).Font.Bold = True 'gras
.FormatConditions.Add xlExpression, Formula1:="=OU(LIGNE()=2;COLONNE()=30)"
.FormatConditions(2).Interior.ColorIndex = 5 'bleu
.FormatConditions(2).Font.ColorIndex = 2 'blanc
.FormatConditions(2).Font.Bold = True 'gras
.FormatConditions.Add xlExpression, Formula1:=True
.FormatConditions(3).Interior.ColorIndex = 1 'noir
.FormatConditions(3).Font.ColorIndex = 2 'blanc
.FormatConditions(3).Font.Bold = True 'gras
End With
If IsError([Inter]) Then Exit Sub 'si la zone n'existe pas
With [Inter]
.FormatConditions.Delete '2 lignes inutiles sur Excel 2003
.FormatConditions.Add xlExpression, Formula1:=True
.FormatConditions(1).Font.Bold = True 'gras
'---clignotement---
If t Then Application.OnTime t, "Clignote", , False 'RAZ du processus s'il existe
affiche = False
Clignote
End With
End Sub
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
If IsError([Sel]) Then Exit Sub
Cancel = True
ThisWorkbook.Names("Sel").Delete
If Not IsError([Inter]) Then ThisWorkbook.Names("Inter").Delete
t = 0
Application.ScreenUpdating = False
Cells.FormatConditions.Delete
[A1:AA1].FormatConditions.Add xlCellValue, xlGreater, 1
[A1:AA1].FormatConditions(1).Font.ColorIndex = 3 'rouge
'[A1:AA1].FormatConditions(1).Font.Bold = True 'gras 'inutile...
End Sub