Faire clignoter une cellule sélectionnée.

Changer la couleur de fond et de la police.
Macro à incorporer dans le module de la feuille.
Public OrigBkgCol As Long, OrigTxtCol As Long
Public OldCell As Range
Sub InitFlash()
Set OldCell = ActiveCell
OrigBkgCol = ActiveCell.Interior.ColorIndex
OrigTxtCol = ActiveCell.Font.ColorIndex
Application.OnTime Now + TimeValue("00:00:01"), "Flash"
End Sub
Sub Flash()
If ActiveCell.Interior.ColorIndex < 0 Then
ActiveCell.Interior.ColorIndex = 1 'fond noir
ActiveCell.Font.ColorIndex = 2 'texte en blanc
Else
ActiveCell.Interior.ColorIndex = (ActiveCell.Interior.ColorIndex + 1) Mod 2
ActiveCell.Font.Color = 1
End If
Application.OnTime Now + TimeValue("00:00:01"), "Flash"
End Sub
'Private Sub Worksheet_SelectionChange(ByVal Target As Range)
' On Error GoTo zut
' OldCell.Interior.ColorIndex = OrigBkgCol
' OldCell.Font.ColorIndex = OrigTxtCol
' OrigBkgCol = Target.Interior.ColorIndex
' OrigTxtCol = Target.Font.ColorIndex
' Set OldCell = Target
'zut:
'End Sub

Retour liens Excel