I have put this thread at the wrong place (VB 5/6) instead of this forum. So I try again with the answers I have got.
I am looking for a way to let a range of an Excel worksheet background blinking.
The blinking should be started from the VB code while opening a messagebox and stopped by pressing OK on that messagebox.
Who knows a way?
Thanks in advance,
Apestaart
Find A Job or Post a Job Opening Click Here.
HughLerwill (Programmer) 12 Jan 07 14:35
I don't think you can set Excel cells to blink, however you may be able to do that by changing their background colours to alternate between two values using a Timer contol on a Form within your vb app.
regards Hugh,
Golom (Programmer) 12 Jan 07 15:04
The other fly in the ointment is that a MsgBox is a modal dialog which means that other processing (including timers for example) is suspended while the message box is displayed. You might need to use the MessageBox API so that you can allow other processing to continue.
apestaart (TechnicalUser) 15 Jan 07 12:26
I have tried some code I found in the threads you mentioned.
It is patialy working, but there are still some problems.
Underneith is my code. I have the following questions.
I can't stop the code Flash1 from running. I try to stop it with commandbutton Stopit.
Also it it not possible to give a given range an other style
(Error message).
Who can help me ?
johnwm (Programmer) 16 Jan 07 2:42
That looks like VBA rather than VB. You will do better in forum707 as this forum is specifically for VB5/6
I am looking for a way to let a range of an Excel worksheet background blinking.
The blinking should be started from the VB code while opening a messagebox and stopped by pressing OK on that messagebox.
Who knows a way?
Thanks in advance,
Apestaart
Find A Job or Post a Job Opening Click Here.
HughLerwill (Programmer) 12 Jan 07 14:35
I don't think you can set Excel cells to blink, however you may be able to do that by changing their background colours to alternate between two values using a Timer contol on a Form within your vb app.
regards Hugh,
Golom (Programmer) 12 Jan 07 15:04
The other fly in the ointment is that a MsgBox is a modal dialog which means that other processing (including timers for example) is suspended while the message box is displayed. You might need to use the MessageBox API so that you can allow other processing to continue.
apestaart (TechnicalUser) 15 Jan 07 12:26
I have tried some code I found in the threads you mentioned.
It is patialy working, but there are still some problems.
Underneith is my code. I have the following questions.
I can't stop the code Flash1 from running. I try to stop it with commandbutton Stopit.
Also it it not possible to give a given range an other style
(Error message).
Who can help me ?
Code:
Module1
Public NextTime As Date
Public Stoppen As Integer
Sub Flash1()
NextTime = Now + TimeValue("00:00:01")
With ActiveWorkbook.Styles("Flash").Font
If .ColorIndex = 2 Then
.ColorIndex = 3
Else
NextTime = Now + TimeValue("00:00:01")
.ColorIndex = 2
End If
End With
Application.OnTime NextTime, "Flash1"
End Sub
Sub StopNu()
Application.OnTime NextTime, "Flash1", schedule:=False
ActiveWorkbook.Styles("Flash").Font.ColorIndex = xlAutomatic
MsgBox "stop nu"
End Sub
Private Sub CommandButton1_Click()
Dim strRange As String
If CommandButton1.Caption = "OK" Then
'Check caption, then change it.
CommandButton1.Caption = "Clicked"
Else
CommandButton1.Caption = "OK"
End If
' Worksheets("Sheet1").Range("a20").Style.Name = "Flash" 'Does not work!!
Call Flash1 'starts the flash1 routine
MsgBox "einde routine"
End Sub
Sub StopIt()
Call StopNu 'Started with command button, but does not work Key press in not seen by the system
MsgBox "Stop nu!"
End Sub
johnwm (Programmer) 16 Jan 07 2:42
That looks like VBA rather than VB. You will do better in forum707 as this forum is specifically for VB5/6