Blinking Text

  • Thread starter Thread starter Jerry
  • Start date Start date
J

Jerry

Hello,

And, THANK YOU for your Time, Help, and Advise!!! :)


Is there a method/function/property/etc. that will cause
text to blink that is placed in a form box object (text
box, list box, label box, etc.) ,,,,even if it takes the
or'ing of a control type character to each byte?

Thanks again for your Time, Help, and Advise!!!! :)

Jerry
 
Hi Jerry

There is a way if you really want
here is an example that Bill Manville posted


The following code will blink any cells that have the style Blink
(create a new style using Format / Style). Format the cell concerned
with style Blink and then run macro Flash to initiate the process.
Since the cell is blank if not showing ERROR you will not see the
blinking unless ERROR is displayed.

Dim NextTime As Date

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

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

OK and THANKS for the reply.

The information you provided is great and it may have to
be the way I go, but what I would like to do is place text
in a Excel UserForm Box (ListBox, Label, ComboBox,
TextBox) whichever is the correct box type to use, and
then make that text BLINK. Any suggestion related to this
would be GREAT. If there is not an easier way to do this
with a FUNCTION/METHOD/PROPERTY, OR'ing special control
type bits to each character would be OK.

Example:
 
Hi Jerry

Sorry I don't know but
Maybe you can use this to give the Active Combobox a color

Private Sub ComboBox1_Enter()
Me.ComboBox1.BackColor = RGB(128, 128, 128)
End Sub

Private Sub ComboBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Me.ComboBox1.BackColor = RGB(256, 256, 256)
End Sub
 
Maybe you could flash it yourself when you show the userform:

Option Explicit
Private Sub UserForm_Activate()
Dim iCtr As Long
For iCtr = 1 To 10
Me.TextBox1.ForeColor = &HFF&
Me.Repaint
Call Sleep(75)
Me.TextBox1.ForeColor = &H80000008
Me.Repaint
Call Sleep(75)
Next iCtr
End Sub

and in a general module:
Option Explicit
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
 
Back
Top