Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Interior.ColorIndex

Status
Not open for further replies.

matrixknow

IS-IT--Management
May 3, 2007
78
I know you have a limited number of VB Constants like vbBlue. How can I find a way or list to find the corresponding number for a certain color. eg. I look for light gray.
 
Try stuff like;

Const Blue = 37, Yellow = 19, Green = 35, Grey = 40, Red = 4

ActiveWorkbook.Colors(37) = RGB(191, 235, 255) 'modify the standard Blue
ActiveWorkbook.Colors(4) = RGB(255, 202, 202) 'modify the standard Red

Range(Cells(4, 1), Cells(5, colLast)).Interior.ColorIndex = Blue
Range(Cells(6, 1), Cells(rowLast, colLast)).Interior.ColorIndex = Yellow
 
Code:
For i = 1 to 56
 cells(i,1).interior.colorindex = i
Next i

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
thanks to all, nice and complete references !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top