![]() |
Flashing cells
I need a code to flashing 4 cells in a workbook of 3 sheets.
1. Sheet 1 (Cell A1) 2. Sheet 2 (Cell B1) and 3. Sheet 3 (Cells C1 and C2). If possible when I open the workbook, I find these 4 cells flashing without the need of run macro. Thank you for your help Masters. |
Flashing cells
No and if it were possible I would advice against it
Some jurisdictions make flashing cells illegal (trouble for those with epilepsy) Think of another way (colour?) to draw attention to the cells best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "MAX" wrote in message ... I need a code to flashing 4 cells in a workbook of 3 sheets. 1. Sheet 1 (Cell A1) 2. Sheet 2 (Cell B1) and 3. Sheet 3 (Cells C1 and C2). If possible when I open the workbook, I find these 4 cells flashing without the need of run macro. Thank you for your help Masters. |
Flashing cells
Max
You can do as follows. In ThisWorkbook module, add: Private Sub Workbook_BeforeClose(Cancel As Boolean) stopFlashing End Sub Private Sub Workbook_Open() startFlashing End Sub In a module, add: 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 Change the code as required for your purpose. -- Robert Author of RibbonX: Customizing the Office 2007 Ribbon: FOR THE LATEST TUTORIALS VISIT: http://www.msofficegurus.com "MAX" wrote: I need a code to flashing 4 cells in a workbook of 3 sheets. 1. Sheet 1 (Cell A1) 2. Sheet 2 (Cell B1) and 3. Sheet 3 (Cells C1 and C2). If possible when I open the workbook, I find these 4 cells flashing without the need of run macro. Thank you for your help Masters. |
Flashing cells
I tried it and it didn't work. Why?
"Robert Martim, Excel" wrote: Max You can do as follows. In ThisWorkbook module, add: Private Sub Workbook_BeforeClose(Cancel As Boolean) stopFlashing End Sub Private Sub Workbook_Open() startFlashing End Sub In a module, add: 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 Change the code as required for your purpose. -- Robert Author of RibbonX: Customizing the Office 2007 Ribbon: FOR THE LATEST TUTORIALS VISIT: http://www.msofficegurus.com "MAX" wrote: I need a code to flashing 4 cells in a workbook of 3 sheets. 1. Sheet 1 (Cell A1) 2. Sheet 2 (Cell B1) and 3. Sheet 3 (Cells C1 and C2). If possible when I open the workbook, I find these 4 cells flashing without the need of run macro. Thank you for your help Masters. |
All times are GMT +1. The time now is 11:26 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com