PDA

View Full Version : Colours



Gordon Scott
10-18-2006, 07:34 AM
Can someone please help. I have a spreadsheet which has a macro in it which runs great but the problem i have is that i need certain colours and can only find 16 QB colours and the codes for the RBG colours dont seem to work. I have attached the colours. Does anyone has any suggestions on where to find them.

Cheers
Gordon

lucas
10-18-2006, 07:39 AM
Hi Gordon,
Please see post #9 of your original thread:
http://www.vbaexpress.com/forum/showthread.php?t=9852

Erdin? E. Ka
10-18-2006, 07:43 AM
Hi Gordon,

Try this codes:


Sub ColorIndex()
Dim i As Byte

For i = 1 To 9
Cells(i + 1, 4) = Cells(i + 1, 1).Interior.ColorIndex
Next i

End Sub

Gordon Scott
10-18-2006, 08:03 AM
Thanks Erdinc, im not good at writing macros, could please write the one for number 3 and then i could copy it for the rest and where do i get the colours from.

Cheers

Gordon

lucas
10-18-2006, 08:16 AM
Gordon,
See attached which is your posted file from post#1 with Erdin? E. Ka's code placed in a standard module.

mdmackillop
10-18-2006, 03:43 PM
Sub AvailableColours()
For i = 0 To 56
Cells(i + 1, 1) = i
Cells(i + 1, 2).Interior.ColorIndex = i
Next
End Sub