Identifying textcolor
The three lines of text are a User Defined Function.
UDFs are very easy to install and use:
1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window
Using it is easy: Say your text is in cell A1. In another cell enter:
=txtclr(A1)
just like SUM or any other function. If the font color in A1 is default,
then -4105 is returned. If the font in A1 is red, then 3 is returned.
There is a different number for each of the 56 colors Excel can support at
one time.
--
Gary''s Student - gsnu200715
"FreddieP" wrote:
Thank you, unfortunately I don't know where to put that text?
Could you also help me there?
I want it to return the color in another column. I don't know if that got
through the last time.
"Gary''s Student" wrote:
Function txtclr(r As Range) As Integer
txtclr = r.Font.ColorIndex
End Function
This UDF will return the number corresponding to the font color.
--
Gary''s Student - gsnu200715
"FreddieP" wrote:
Hi.
I have in a single column the letter S written and it is formatted in
different colors. I would like to identify the different colors.
If it is black just return B or what ever word, just something sop I can
separate them from each other.
Like an if formula only it searches for formatting instead of a value.
Kind regardas
Freddie
|