1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| Dim FC As Object
Dim Bool As Boolean
Dim CouleurMFC&
Sub ClignotementMFC(Optional dummy As Byte)
Dim Couleurs
Static Passe%
'---
If Not Bool Then
Passe% = 0
Exit Sub
End If
'--- Les couleurs ---
Couleurs = Array(vbRed, vbCyan) '(vbRed, vbCyan,vbGreen, vbMagenta, vbYellow)
'--- Applique les couleurs ---
If Passe% > UBound(Couleurs) Then Passe% = 0
FC.Interior.Color = Couleurs(Passe%)
Passe% = Passe% + 1
'--- Relance la procédure toutes les secondes ---
Application.OnTime Now + TimeValue("00:00:01"), "ClignotementMFC"
End Sub
Sub LanceClignotementMFC()
Dim FC2 As FormatCondition
'---
If Bool Then Exit Sub
'--- Identifie la MFC et mémorise sa couleur d'origine ---
For Each FC2 In ActiveSheet.Cells.FormatConditions
Set FC = FC2
CouleurMFC& = FC.Interior.Color
Next FC2
'--- Appelle la procédure de colorisation ---
If Not FC Is Nothing Then
Bool = True
Call ClignotementMFC
End If
End Sub
Sub StopClignotementMFC()
Bool = False
Call ClignotementMFC
If Not FC Is Nothing Then
FC.Interior.Color = CouleurMFC& 'remet la couleur d'origine
Set FC = Nothing
End If
CouleurMFC& = 0
End Sub |
Partager