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

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690
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

Wild Bill

Board Regular
Joined
Feb 20, 2006
Messages
125
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

Diablo II

Well-known Member
Joined
Sep 28, 2008
Messages
538
try

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Range("A1") = 10 Then
Call MsgExample1
end sub
 
Upvote 0

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
40,380
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
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

Diablo II

Well-known Member
Joined
Sep 28, 2008
Messages
538
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,191,095
Messages
5,984,637
Members
439,898
Latest member
Zack0611

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
Top