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...
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?
BBowen6501
Sep 26, 2022Copper Contributor
Is 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 - BBowen6501Sep 27, 2022Copper ContributorStill no luck.
- HansVogelaarSep 27, 2022MVP
If you really really want this, see the attached sample workbook. There is code in ThisWorkbook and in Module1. Both are required.