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 48 49 50 51 52 53 54 55 56 57 58 59
| Private Sub Worksheet_Activate()
Dim n As Byte
Dim Start As Variant
Dim i As Integer
Const Texte As String = ""
For i = 1 To 10 'Nombre de flashes 10
If [D9] >= 100 Then
Cells(9, 4).Font.ColorIndex = 6
Cells(9, 4).Interior.ColorIndex = 3
End If
If [D11] >= 40 Then
Cells(11, 4).Font.ColorIndex = 6
Cells(11, 4).Interior.ColorIndex = 3
End If
For n = 1 To 40 'Intervalle des flashes
Start = Timer
Do While Timer < Start + 1 / 100
Loop
If n Mod 20 = 0 Then 'Durée des flashes
Cells(9, 4).Interior.ColorIndex = xlNone
Cells(9, 4).Font.ColorIndex = 1
Cells(11, 4).Interior.ColorIndex = xlNone
Cells(11, 4).Font.ColorIndex = 1
End If
Next n
Next i
Exit Sub
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim n As Byte
Dim Start As Variant
Dim i As Integer
Const Texte As String = ""
For i = 1 To 10 'Nombre de flashes 10
If [D9] >= 100 Then
Cells(9, 4).Font.ColorIndex = 6
Cells(9, 4).Interior.ColorIndex = 3
End If
If [D11] >= 40 Then
Cells(11, 4).Font.ColorIndex = 6
Cells(11, 4).Interior.ColorIndex = 3
End If
For n = 1 To 40 'Intervalle des flashes
Start = Timer
Do While Timer < Start + 1 / 100
Loop
If n Mod 20 = 0 Then 'Durée des flashes
Cells(9, 4).Interior.ColorIndex = xlNone
Cells(9, 4).Font.ColorIndex = 1
Cells(11, 4).Interior.ColorIndex = xlNone
Cells(11, 4).Font.ColorIndex = 1
End If
Next n
Next i
Exit Sub
End Sub |
Partager