Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Flashing cells
I tried the code below for flashing cells, and it didn't work.
Will you please help me. CODE: In Workbook Private Sub Workbook_BeforeClose(Cancel As Boolean) stopFlashing End Sub Private Sub Workbook_Open() startFlashing End Sub In Module Option Explicit Dim nextSecond Sub startFlashing() flashCell End Sub Sub stopFlashing() On Error Resume Next Application.OnTime nextSecond, "flashCell", , False End Sub Sub flashCell() nextSecond = Now + TimeValue("00:00:01") Application.OnTime nextSecond, "flashCell" If Range("B1").Interior.ColorIndex = 36 Then Range("B1").Interior.ColorIndex = 41 Range("B1").Value = "Light Blue" ElseIf Range("B1").Interior.ColorIndex = 41 Then Range("B1").Interior.ColorIndex = 36 Range("B1").Value = "Light Yellow" End If End Sub |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Flashing cells
Try already published techniques of doing this:
http://www.vbaexpress.com/kb/getarticle.php?kb_id=891 -- "Actually, I *am* a rocket scientist." -- JB Your feedback is appreciated, click YES if this post helped you. "MAX" wrote: I tried the code below for flashing cells, and it didn't work. Will you please help me. CODE: In Workbook Private Sub Workbook_BeforeClose(Cancel As Boolean) stopFlashing End Sub Private Sub Workbook_Open() startFlashing End Sub In Module Option Explicit Dim nextSecond Sub startFlashing() flashCell End Sub Sub stopFlashing() On Error Resume Next Application.OnTime nextSecond, "flashCell", , False End Sub Sub flashCell() nextSecond = Now + TimeValue("00:00:01") Application.OnTime nextSecond, "flashCell" If Range("B1").Interior.ColorIndex = 36 Then Range("B1").Interior.ColorIndex = 41 Range("B1").Value = "Light Blue" ElseIf Range("B1").Interior.ColorIndex = 41 Then Range("B1").Interior.ColorIndex = 36 Range("B1").Value = "Light Yellow" End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
flashing cells | Excel Worksheet Functions | |||
Flashing cells | Excel Worksheet Functions | |||
Flashing cells | Excel Discussion (Misc queries) | |||
flashing cells | Excel Discussion (Misc queries) | |||
Excel Flashing Cells | Excel Discussion (Misc queries) |