Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Blinking Text in Excel

Status
Not open for further replies.

MBLR

IS-IT--Management
Jun 13, 2002
89
IN
Can I make a text in a cell to blink? If yes, how?
 
Follow these steps:
'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

Run the StopIt sub to stop the text blinking

HTH Rgds
~Geoff~
 

In My excel i do not have Flash/ Add under Format / Style. do I need to install any additional component?

 
Go to Format>Style
There will be a combobox with drop down list - just type Flash into there and then click on "Add" Rgds
~Geoff~
 
I'm sorry, but I don't understand the direction to "run the procedure "Flash" from Auto-Open"

I've entered the code into my Personal.xls module. The Flash code seems to be operating properly. I get the following error when running the StopIt code: "Method 'OnTime' of object '_Application' failed"

Assistance appreciated!
 
Have you declared NextTime as a public variable (ie outside of either of the subs) ??

Rgds, Geoff

Never test the depth of water with both feet

Help us to help you by reading FAQ222-2244 before you ask a question
 
Hi - I am looking for a little more help on this - I am trying to get text to blink in an excel worksheet - I added a "flash" style -

I then added the following in vb

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
------------------------
Private Sub Workbook_Open()
Flash
End Sub

I think my problem is that I don't know what auto open is - I am sure I am calling the procedure from the wrong place ???

Any help would be greatly appreciated.

Thanks!!!

Fred
 
I'm sorry - I needed to tinker a little more - I understand now that auto-open should be a macro -

I should be ok now -

thanks!!!

Fred
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top