flash a range if a value is present

still learning

Well-known Member
Joined
Jan 15, 2010
Messages
782
Office Version
  1. 365
Platform
  1. Windows
Hi
I got help with a macro to flash a cell if a string was present due to an If statement, from HERE. Thank you very much!!!!
I'm trying to modify it to flash a cell with a value instead of a string
When "Balance1" is = to or less than 100, I want "Balance" to flash a couple of times. "balance" is the result of an If statement
VBA Code:
Sub flash()
Dim i As Long
If Range("Balance1").Value = "<=100" Then
            Application.EnableEvents = False
            With Range("balancee")
                For i = 1 To 1
                    .Font.ColorIndex = 2
                    Application.Wait (Now + TimeValue("00:00:01"))
                    .Font.ColorIndex = 3
                    Application.Wait (Now + TimeValue("00:00:01"))
                Next i
            End With
            Application.EnableEvents = True
        End If
End Sub
mike
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Change this line:
VBA Code:
If Range("Balance1").Value = "<=100" Then
to this:
VBA Code:
If Range("Balance1").Value <=100 Then
 
Upvote 0
Solution
nice easy one to start the weekend! As long as the value is a number changing the criteria line to this should work. You don't want the quotation marks unless you're working with strings or in some formulas.

VBA Code:
If Range("Balance1").Value <= 100 Then
 
Upvote 0

Forum statistics

Threads
1,214,551
Messages
6,120,161
Members
448,948
Latest member
spamiki

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