PATTERNCOLORINDEX identification sub?

ChrisOK

Well-known Member
Joined
Mar 26, 2003
Messages
601
I'm using this code and need to change the color. Is there a short chunk of vba code (Sub) I can use to identify other cells individually to find out the code equivalent?

I've found cross refc charts such as these Color Palette and the 56 Excel ColorIndex Colors that show RGB color numbers 1-56, etc but I'm needing one that will show the below types of colors... "3407820"

EXAMPLE USAGE: I'd like to be able to open an blank sheet, use the normal color fill chart to colorized a cell then run the vba sub to have it tell me what the code equivalent would be to get a code like the one below...

Code:
    Range("D2:D1000").Select
    Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$B2<$D2"
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .Color = 3407820
        .TintAndShade = 0
    End With
    Selection.FormatConditions(1).StopIfTrue = True
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,226,730
Messages
6,192,698
Members
453,747
Latest member
tylerhyatt04

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