Font Color Index / Name Source

G

Guest

I have a need to display font color names by feeding the color index number
to "something". When I hold the mouse on a color in the palette the name
displays. Is there a source accessable by VBA or do I have to build a
procedure or function on my own?

Thanks.
 
B

Bob Phillips

No, it is not readily accessible. I suggested this once before, not
infallible but it works (sort of).

CommandBars("Formatting").Controls("&Fill Color").TooltipText

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)
 
J

Jim Cone

I've just written an Excel add-in (Determine Colors) that creates a new
menu on the cell right-click popup menu. It lists cell color, font color and
cell address. I am looking for feedback and trying to determine if there
is any demand for it. I anticipate it would be a giveaway program.
Email me if you want to give it a try...
(e-mail address removed)
(remove xxx)
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Neal Zimm"
wrote in message
I have a need to display font color names by feeding the color index number
to "something". When I hold the mouse on a color in the palette the name
displays. Is there a source accessable by VBA or do I have to build a
procedure or function on my own?
Thanks.
Neal Z
 
G

Guest

Thanks, their solutions are pretty close to mine. I built a string array
indexed by the colorindex number to return a string containing the name. I
filled in the "missing" numbers with a dummy color name called "Invalid".


to get the names i just recorded a macro click on each one of the colors in
the font palette.

good enough for me.
 
G

Guest

Hi Jim-
Thanks for the offer. I may try it out in a couple of weeks. For my needs
now, it would be overkill. I just built a string array indexed by the
font.colorindex number and it works well enough for me.
 
J

Jim Cone

You might want to customize some workbook colors and also change
the font in a cell so that the text uses two or more colors; then test
your code.
--
Jim Cone
San Francisco, USA
http://www.officeletter.com/blink/specialsort.html


"Neal Zimm" <[email protected]>
wrote in message
Hi Jim-
Thanks for the offer. I may try it out in a couple of weeks. For my needs
now, it would be overkill. I just built a string array indexed by the
font.colorindex number and it works well enough for me.
 
P

Peter T

Just to add, Jim's suggestion is worth following up should your function
need to work with a non default palette, as the method you described will
return wrong colours. Try swapping red and yellow and test.

With ActiveWorkbook
.Colors(3) = vbYellow
.Colors(6) = vbRed
End With

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top