prinztegame
New Member
- Joined
- Dec 12, 2010
- Messages
- 22
Good morning to all of you people, I need some help to solve a problem. I have the following macro that allows a cell to flash alternatively red and yellow when a condition is met:
Sub Flash()
If Range("K13").Value = "TRUE" Then
Dim PauseTime, Start, Finish
For x = 1 To 4
PauseTime = 0.5
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Range("H37").Cells.Interior.ColorIndex = 3
Loop
Finish = Timer
PauseTime = 0.5
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Range("H37").Cells.Interior.ColorIndex = 6
Loop
Finish = Timer
Next x
Range("H37").Cells.Interior.ColorIndex = xlNone
End
End If
End Sub
Does anyone know why I get an "Error 1004 - impossibile to execute - Color Index" whenever the sheet is protected with a password, and I don't when the sheet is free?
Since I need to protect the sheet does anyone knows how to solve the problem?
Thank you very much in advance to all of you!!!
Sub Flash()
If Range("K13").Value = "TRUE" Then
Dim PauseTime, Start, Finish
For x = 1 To 4
PauseTime = 0.5
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Range("H37").Cells.Interior.ColorIndex = 3
Loop
Finish = Timer
PauseTime = 0.5
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Range("H37").Cells.Interior.ColorIndex = 6
Loop
Finish = Timer
Next x
Range("H37").Cells.Interior.ColorIndex = xlNone
End
End If
End Sub
Does anyone know why I get an "Error 1004 - impossibile to execute - Color Index" whenever the sheet is protected with a password, and I don't when the sheet is free?
Since I need to protect the sheet does anyone knows how to solve the problem?
Thank you very much in advance to all of you!!!