Faire un clic-droit sur ici ou cliquer sur "Insertion" du menu.
Sur le module, ajouter ces lignes de code:
Sub Blink()
Const ColorIdx1 = 37
Const ColorIdx2 = xlColorIndexNone
If Worksheets("Sheet1").Range("A1").Interior.ColorIndex = ColorIdx1 Then
Worksheets("Sheet1").Range("A1").Interior.ColorIndex = ColorIdx2
Worksheets("Sheet1").Range("A2").Interior.ColorIndex = ColorIdx1
Else
Worksheets("Sheet1").Range("A1").Interior.ColorIndex = ColorIdx1
Worksheets("Sheet1").Range("A2").Interior.ColorIndex = ColorIdx2
End If
Application.OnTime Now + TimeValue("00:00:01"), "Blink"
End Sub
Const ColorIdx1 = 37
Const ColorIdx2 = xlColorIndexNone
If Worksheets("Sheet1").Range("A1").Interior.ColorIndex = ColorIdx1 Then
Worksheets("Sheet1").Range("A1").Interior.ColorIndex = ColorIdx2
Worksheets("Sheet1").Range("A2").Interior.ColorIndex = ColorIdx1
Else
Worksheets("Sheet1").Range("A1").Interior.ColorIndex = ColorIdx1
Worksheets("Sheet1").Range("A2").Interior.ColorIndex = ColorIdx2
End If
Application.OnTime Now + TimeValue("00:00:01"), "Blink"
End Sub
Et ajouter ces lignes de code dans ThisWorkBook:
Private Sub Workbook_Open()
Blink
End Sub
Blink
End Sub
ThisWorkbook est ici.
Exécuter le Blink fonction. A1 et A2 de Sheet1 clignote toute les secondes.
Aucun commentaire:
Enregistrer un commentaire