Forum Discussion
BBowen6501
Sep 26, 2022Copper Contributor
Auto on/off blink cells
Hi! I have been banging my head on my desk for several days now trying to make any of 3 cells blink in a worksheet when a specific criteria has been me. Brief synopsis: One worksheet (WS1) au...
mtarler
Sep 26, 2022Silver Contributor
reconfigure your macro to do the "loop" only once setting all of the corresponding cells you want to blink to the range you are 'blinking'. you can either use a Union operator or when defining the Range("cell1, cell2").
PS- I completely agree with Hans that this isn't a preferred method for a number of reasons. For me I agree with performance issue (but only a couple blinks shouldn't be too bad) but more so because if they don't see those couple of flashes then what? Also, this solution requires macros which means if they don't enable macros or go to excel online it doesn't work.
I agree bright RED cells with BOLD YELLOW Font or the such is better in the long run.
BBowen6501
Sep 26, 2022Copper Contributor
Okay. I tried comma separation before, which did make all 3 cells blink, but it disregarded the "PARTS" condition and just blinked them all anyway. Simply use an & between range defs?
- BBowen6501Sep 26, 2022Copper ContributorIs there an "Or" union option to use here so they work independently of one another?
- mtarlerSep 26, 2022Silver ContributorI was thinking something like:
cells2blink=""
If Range("A23").Value = "PARTS" Then
cells2blink=cells2blink & "A23, "
end if
If Range("A31").Value = "PARTS" Then
cells2blink=cells2blink & "A31, "
end if
If Range("A39").Value = "PARTS" Then
cells2blink=cells2blink & "A39, "
end if
if LEN(cells2blink)>1 then
cells2blink=Left(cells2blink, LEN(cells2blink)-2)
Set CellToBlink = Range(cells2blink)
cont with blink...- BBowen6501Sep 27, 2022Copper ContributorThis is making cell A23 work, though.
Sub BlinkCell()
Dim CellToBlink As Range
If Range("A23").Value = "PARTS" Or Range("A31").Value = "PARTS" Or Range("A39").Value = "PARTS" Then
Set CellToBlink = Range("A23")
Do While Range("A23").Value = "PARTS" Or Range("A31").Value = "PARTS" Or Range("A39").Value = "PARTS"
Application.Wait (Now + TimeValue("00:00:01"))
CellToBlink.Interior.ColorIndex = 0
Application.Wait (Now + TimeValue("00:00:01"))
CellToBlink.Interior.ColorIndex = 3
Application.Wait (Now + TimeValue("00:00:01"))
DoEvents
Loop
If Range("A23").Value = "PARTS" Or Range("A31").Value = "PARTS" Or Range("A39").Value = "PARTS" Then
Set CellToBlink = Range("A31")
Do While Range("A23").Value = "PARTS" Or Range("A31").Value = "PARTS" Or Range("A39").Value = "PARTS"
Application.Wait (Now + TimeValue("00:00:01"))
CellToBlink.Interior.ColorIndex = 0
Application.Wait (Now + TimeValue("00:00:01"))
CellToBlink.Interior.ColorIndex = 3
Application.Wait (Now + TimeValue("00:00:01"))
DoEvents
Loop
If Range("A23").Value = "PARTS" Or Range("A31").Value = "PARTS" Or Range("A39").Value = "PARTS" Then
Set CellToBlink = Range("A39")
Do While Range("A23").Value = "PARTS" Or Range("A31").Value = "PARTS" Or Range("A39").Value = "PARTS"
Application.Wait (Now + TimeValue("00:00:01"))
CellToBlink.Interior.ColorIndex = 0
Application.Wait (Now + TimeValue("00:00:01"))
CellToBlink.Interior.ColorIndex = 3
Application.Wait (Now + TimeValue("00:00:01"))
DoEvents
Loop
End If
End If
End If
End Sub