Eloise T
Active Member
Please see attachment. I would like the macro "StartFlashing" to cause any cell in Column K to flash if it contains the Unicode U221A which is the square root symbol (√). Thank you in advance for any assistance.
Code:
Sub StartFlashing()
Dim Ws As Worksheet, Rg(1) As Range
Application.ScreenUpdating = False
For Each Ws In Worksheets
Set Rg(1) = Ws.Cells(Rows.Count, 1).End(xlUp)
Do Until Rg(1).FormatConditions.Add Type:=xlExpression, Formula1:="=IF($K$3:$K$6000)=UNICHAR(221A) Or Rg(1).Row < 3
If Rg(1)(0).Value = "" Or Rg(1)(0).FormatConditions.Add Type:=xlExpression, Formula1:="=IF($K$3:$K$6000)=UNICHAR(221A) Then "StartFlashing"
Set Rg(0) = Rg(1)
Else
Set Rg(0) = Rg(1).End(xlUp)
If Rg(0).Row < 3 Then Set Rg(0) = Ws.[A3]
End If
' Debug.Print Rg(1).Address
With Range(Rg(0), Rg(1)(1, 8)).Columns
.FormatConditions.Add Type:=xlExpression, Formula1:="=IF($K$3:$K$6000)=UNICHAR(221A) Then "StartFlash"
End With
Set Rg(1) = Rg(0).End(xlUp)
xTime = Now + TimeSerial(0, 0, 1)
Application.OnTime xTime, "StartFlashing", , True
Loop
Next
Erase Rg
Application.ScreenUpdating = True
Beep
End Sub
Sub StopFlashing()
Application.OnTime xTime, "StartFlashing", , False
End Sub