Make Cells Blink that Contain a specific value.

Tiger9136

New Member
Joined
Jul 10, 2017
Messages
19
Hello,

I have watched multiple videos but cannot seem to find the answer that I am looking for. I am wanting to look at a range of cells and if that range of cells is equal to a cell with specific criteria make it blink.

For Example:

Cell A2 = Reference cell containing "=Today()"

I want to look at cells C1,D1,E1,F1,G1,H1,I1

If any of those cells are =A2 then blink

Cell C1 = 16-Nov-19
Cell D1 = 17-Nov-19
Cell E1 = 18-Nov-19
Cell F1 = 19-Nov-19
Cell G1 = 20-Nov-19 (This cell would blink)
Cell H1 = 21-Nov-19
Cell I1 = 22-Nov-19

Can someone help with the VBA to make this work?

Thanks
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
INSERT A MODULE
Press Alt-F11 to open the VBA editor. From the menu select Insert > Module. On the sheet that opens, paste the following code.

VBA Code:
Public wTime
Sub StartBlink()
  Dim f As Range
  Set f = Range("C:C").Find(Range("A2").Value, , xlFormulas, xlWhole)
  If Not f Is Nothing Then
    If f.Interior.ColorIndex = 6 Then ' Amarillo
      f.Interior.ColorIndex = 3     ' Rojo
    Else
      f.Interior.ColorIndex = 6     ' Amarillo
    End If
  End If
  wTime = Now + TimeSerial(0, 0, 1)
  Application.OnTime wTime, "StartBlink", , True
End Sub

Sub StopBlink()
  On Error Resume Next
  Application.OnTime wTime, "StartBlink", , False
End Sub

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

Put the follong code in events of ThisWorkbook

VBA Code:
Private Sub Workbook_Open()
  Call StartBlink
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
  Call StopBlink
End Sub

-------------------------
IN THISWORKBOOK
Place this macro in the code module for ThisWorkbook. Do the following: Hold down the ALT key and press the F11 key. This will openthe Visual Basic Editor. In the left hand pane, double click on "ThisWorkbook". Copy/paste the macro into the empty window that opens up. Save the workbook as a macro-enabled file, close it and then re-open it.

-------------------------
To stop the blink run stopblink macro at any time.
 
Upvote 0

Forum statistics

Threads
1,214,992
Messages
6,122,631
Members
449,095
Latest member
bsb1122

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