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
| Option Explicit
Dim t As Long
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Select Case Target.Address
Case "$AG$25"
t = 0
Do While t < 15
If Range("AG20:AG23").Font.Color = RGB(255, 255, 0) Then
Range("AG20:AG23").Font.Color = RGB(0, 0, 0)
Range("aG24").Font.Color = RGB(0, 0, 0)
Application.Wait Now + TimeValue("00:00:01")
DoEvents
Else
Range("AG20:AG23").Font.Color = RGB(255, 255, 0)
Range("AG24").Font.Color = RGB(255, 255, 0)
Application.Wait Now + TimeValue("00:00:01")
DoEvents
End If
t = t + 1
Loop
Case "$AG$26"
t = 15
Range("AG20:AG23").Font.Color = RGB(255, 255, 255)
Range("AG24").Font.Color = RGB(255, 255, 255)
End Select
End Sub |
Partager