Question 10: how to make the text in the worksheet flash?
A: To make the text flash, you need to periodically execute Program The ontime method can be used to periodically run a program.
'*************************************** ***********
Public runwhen as double
Sub startblink ()
If range ("A1"). Font. colorindex = 2 then
Range ("A1"). Font. colorindex = xlcolorindexautomatic
Else
Range ("A1"). Font. colorindex = 2
End if
Runwhen = now + timeserial (0, 0, 1)
Application. ontime runwhen, "startblink", true
End sub
'*************************************** ***********
Sub stopblink ()
Range ("A1"). Font. colorindex = xlcolorindexautomatic
Application. ontime runwhen, "startblink", false
End sub
In the above programs, you can change the cell or cell area of the parameter A1. When opening a workbook, You need to initialize this program. Therefore, you can place the following Code To the thisworkbook code module.
'*************************************** ***********
Private sub workbook_open ()
Startblink
End sub
When the workbook is closed, you need to cancel the ontime event. Therefore, you need to place the following code in the thisworkbook code module.
'*************************************** ***********
Private sub workbook_beforeclose (cancel as Boolean)
Stopblink
End sub
For more information, see excel.xls. Uploadfiles/2006-8/81151110. rar
The above content comes from
Http://blog.excelhome.net/user1/fanjy/archives/2006/555.html