color index

  • Thread starter Thread starter marina madeleine
  • Start date Start date
M

marina madeleine

Does anyone know how I can find the color numbers in VB Excel for the
color index. For example, for the color aqua?

Thanks.

Marina Madeleine
 
Hi Marina,
you can find the color index in the visual basic help.
Enter "colorindex" and you get the description for the use
of the available numbers. For aqua it might be number 50.

Anne
 
See, "ColorIndex Property" in VBA help.
Aqua (sea) have ColorIndex = 8

HTH
Mark
 
Hi Marina,

If you mean colour numbers 0 to 1677215 these can be
returned with a simple routine:

Sub CxToCvalue()
Dim i As Byte
For i = 1 To 56
Cells(i, 1).Interior.ColorIndex = i
Cells(i, 2) = i
Next
End Sub

There is no direct way to return any information about the
colour descriptions (eg Aqua) you see in the tooltips when
you hover over the palette. But you may find links in this
NG to code which includes "hardcoded" details relating to
the colour descriptions.

There are eight intuitively named "Color Constants", eg
MsgBox vbYellow, , vbRed

Also 0 to 15 colours with the "QBColor" function (does not
include Aqua!)

Regards,
Peter
 

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

Back
Top