visual basic colour codes!

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
The ColorIndex for white is 2. Is that what you're talking about? e.g.

Range("A1").Font.ColorIndex = 2

You can type ColorIndex Property into VBA help to get a full list.

HTH,
D
 
Upvote 0
Hi

White is VBA 2, try 1 2 3 4 if unsure or check in help files sure its there.

BTW on old borad there was some guru who posted some code that bacgs out all colours in one column and the number next ! very cool if lasy like me.. i must have it some where but not archived in my knowledge base yet sorry, have a look..
 
Upvote 0
I had the VBA Code. (Kept it from an earlier post)

Sub ColorIndices()
For i = 1 To 56
Cells(i, 1).Interior.ColorIndex = i
Cells(i, 2).Value = i
Next i
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,266
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top