Blink cell based on cell color or another cell

denz0215

New Member
Joined
Dec 20, 2023
Messages
4
Office Version
  1. 365
Platform
  1. Windows
HI all,

I'm trying to make a cell blink based on the color of another cell.
BTW this is a deadline monitoring tool. cant seem to make it work.
here is my code below.
-----------------------------------------------------------------------------------------------
Option Explicit
Public CellCheck As Boolean

Private Sub Worksheet_Change(ByVal Target As Excel.Range)

'Change the IF statement and cell range to what you need
If Range("u8").Interior.ColorIndex = "3" Then
Call StartBlink
CellCheck = True
ElseIf Range("u8").Interior.ColorIndex <> "3" Then
Call StopBlink
CellCheck = False

End If
End Sub

-------------------------------------------------------------------------------------------------

Option Explicit
Public RunWhen As Double

Sub StartBlink()
If Range("g8").Interior.ColorIndex = 3 Then
Range("g8").Interior.ColorIndex = 6
Else
Range("g8").Interior.ColorIndex = 3
End If
RunWhen = Now + TimeSerial(0, 0, 1)
Application.OnTime RunWhen, "StartBlink", , True
End Sub


Sub StopBlink()
Range("g8").Interior.ColorIndex = 0
Application.OnTime RunWhen, "StartBlink", , False
End Sub

------------------------------------------------------------------------------------
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
HI all,

I'm trying to make a cell blink based on the color of another cell.
BTW this is a deadline monitoring tool. cant seem to make it work.
here is my code below.
-----------------------------------------------------------------------------------------------
Option Explicit
Public CellCheck As Boolean

Private Sub Worksheet_Change(ByVal Target As Excel.Range)

'Change the IF statement and cell range to what you need
If Range("u8").Interior.ColorIndex = "3" Then
Call StartBlink
CellCheck = True
ElseIf Range("u8").Interior.ColorIndex <> "3" Then
Call StopBlink
CellCheck = False

End If
End Sub

-------------------------------------------------------------------------------------------------

Option Explicit
Public RunWhen As Double

Sub StartBlink()
If Range("g8").Interior.ColorIndex = 3 Then
Range("g8").Interior.ColorIndex = 6
Else
Range("g8").Interior.ColorIndex = 3
End If
RunWhen = Now + TimeSerial(0, 0, 1)
Application.OnTime RunWhen, "StartBlink", , True
End Sub


Sub StopBlink()
Range("g8").Interior.ColorIndex = 0
Application.OnTime RunWhen, "StartBlink", , False
End Sub

------------------------------------------------------------------------------------
BTW g8 cell color background is based on conditional formatting where if the date inputted is nearing a deadline, it will change color.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,239
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top