Link to home
Create AccountLog in
Avatar of dgd1212
dgd1212

asked on

How to call a macro when a cell goes from black text to red text

I have macro's in place to manually run if certain cells have red text. Is there a way to call a macro w/o manual intervention when a cells text changes from black to red?
Thanks
Avatar of Norie
Norie

How/why are you changing the cell colour?
hI

You can do something like below:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim lRow As Long
Dim iCntr As Long
lRow = 20
For iCntr = lRow To 1 Step -1
If Cells(iCntr, 1).Font.ColorIndex = 3 Then
CommandButton1.Value = True
End If
Next
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Wilder1626
Wilder1626
Flag of Canada image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of dgd1212

ASKER

Thanks!