Macro triggered by change in font color?

Wild Bill

Board Regular
Joined
Feb 20, 2006
Messages
125
Is there any way to trigger a macro in response to a change in font color only? Worksheet_change does not respond.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Not to my knowledge!! What exactly are you trying to do? How is the Font color changed? Manually or via Conditional Formatting?
lenze
 
Upvote 0
I want to respond to a manual change in font color. The purpose is to restrict the user to one of only three font colors. We're using font color to indicate status and I'm generating some simple statistics based on it so I don't want other font colors to be used.

Is there a way perhaps to restrict selection of font colors to a short defined list?
 
Upvote 0
try

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Range("A1") = 10 Then
Call MsgExample1
end sub
 
Upvote 0
There is no event raised by changing font colours. You could try and hook every possible means of changing the font colour, or you could make your life easier and add some sort of status value which would allow you to use built-in functions for reporting and conditional formatting if you need colours.
 
Upvote 0
here i one you cam play with.

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim bGreaterThantext As Boolean
Range("G2").Select
   If ActiveCell.Value = "text" Then bGreaterThantext = True
   'other statements
   If bGreaterThantext Then
        Selection.Font.ColorIndex = 5
   End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,575
Messages
6,120,342
Members
448,956
Latest member
Adamsxl

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