conditional formatting color macro

fastballfreddy

Board Regular
Joined
Jan 13, 2015
Messages
57
Office Version
  1. 2016
Platform
  1. Windows
I recorded a macro for adding conditional formatting with part of the code below. I am wanting to know if there is a way to find the color numbers below or is there a substitute code to replace the below code?

when the macro was recording I inputed the hex codes below and the macro created the color numbers. How do I find the color numbers?
Color 12009743 = hex #F1BE48
Color 3018952 = hex #C8102E

VBA Code:
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Font
        .Color = -12009743
        .TintAndShade = 0
    End With
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .Color = 3018952
        .TintAndShade = 0
    End With
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
More context is needed. What exactly are you trying to do?
 
Upvote 0
I want to add multiple conditonal formatting scenarios with macro. The conditional formatting will update the fill color and the font color. Below is a list of just 4 Hex #s that i have to update. When I recorded the macro for one example it came back with numbers 12009743 (hex #F1BE48) & 3018952 (hex #C8102E). Is there a way to find those numbers online or a way to code to update hex# instead of the numbers the recording came back with? Hope that clarifies and thanks for the reply.

HEX FILLHEX FONT
C8102EF1BE48
4B116FFFCC00
E8000D0051BA
fcd116000000
 
Upvote 0
Figured it out. just needed to replace the -12009743 & 3018952 with RGB coding.

VBA Code:
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Font
        .Color = [B][COLOR=rgb(184, 49, 47)]RGB(0, 0, 0)[/COLOR][/B]
        .TintAndShade = 0
    End With
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .Color = [COLOR=rgb(184, 49, 47)][B]RGB(252, 209, 22)[/B][/COLOR]
        .TintAndShade = 0
    End With
 
Upvote 0
Solution

Forum statistics

Threads
1,214,970
Messages
6,122,514
Members
449,088
Latest member
RandomExceller01

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