How To Make A Word Flash?

  • Thread starter Thread starter Wayne
  • Start date Start date
W

Wayne

I am making a form in which there are many check boxes,
etc.
I would like to set up that if a check box is checked,
there is a function the makes a word or words in the cell
next to it flash as a warning or 'dont forget' message.

How could this be done?

Thanks
 
Wayne,

Below is code that will make a cell's text flash, along with an explanation of how to make it work.

Since you are using checkboxes, you can use the checkboxes' click event to call Flash or StopIt, as appropriate.

Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
Flash
Else
StopIt
End If
End Sub

HTH,
Bernie

'VBA CODE EXAMPLES
'
'Created by Bill Manville
'
'To create a blinking cell:
'
'If you define a new Style (Format / Style / Flash/ Add ) and apply
'that style to the cells you want to flash, paste the following code
'into a module sheet and run the procedure Flash from Auto-Open if
'desired you will get the text flashing alternately white and red.

Dim NextTime As Date

Sub Flash()
NextTime = Now + TimeValue("00:00:01")
With ActiveWorkbook.Styles("Flash").Font
If .ColorIndex = 2 Then
.ColorIndex = 3
Beep
Else: .ColorIndex = 2
End If
End With

Application.OnTime NextTime, "Flash"
End Sub

Sub StopIt()
Application.OnTime NextTime, "Flash", schedule:=False
ActiveWorkbook.Styles("Flash").Font.ColorIndex = xlAutomatic
End Sub
 
Back
Top