VBA Macro for Identifying Background Color

jtw5112

New Member
Joined
Dec 21, 2018
Messages
3
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545}p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545; min-height: 14.0px}</style>I am reaching out to you guys because I have no experience with VBA but I do believe my problem can be solved through VBA.


Looking to the below spreadsheet, you can see that the cells in the data area are color coded. Columns F2:H2 will act as keys when filtering the data. Basically, I need a macro that starts at one of these key columns, checks each row if there is ANY cell that matches the color in the key column you’re on and if true, fills the background color of the cell in the corresponding evaluated row and key column, if false, leave blank. An example of the end result of the macro is shown in the image.


Using these key columns we can filter for every row that has any cell with that background color. When filtering, it’s completely fine that other colors get pulled in depending on the row, we just have to make sure all of the data for the color being filtered gets captured.


I’d be happy to provide additional clarification if needed. I’d appreciate any help on this as it would be a huge time saver for us but I have no experience with VBA.


Thanks!

csSnYNi.png
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Cross posted https://www.excelforum.com/excel-pr...a-macro-for-identifying-background-color.html

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0
Is this the rule?
- cells containing any numeric value in columns B:E should be coloured to match F,G or H

Should cells with no value be coloured grey?

Is zero a "value" and coloured or "blank" and therefore "grey"?

How are F,G & H coloured - manually or by conditional formatting?

Are F,G & H always the filtering keys?
- ie your data is always 5 columns wide plus 3 filtering columns
 
Upvote 0
Cross posted https://www.excelforum.com/excel-pr...a-macro-for-identifying-background-color.html

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.

So sorry about that! Will do so going forward.
 
Upvote 0
The cells containing any numeric value typically will have 4, 5, or 13 columns and there can be one or more key columns as well.

There are greyed out cells but they will never be a key column color. However, rows with grey cells and colored cells should fill the corresponding key column with the key color. So, key column cells should be filled anytime there is a matching color in that row regardless of whether there are other colors in that row.

F, G, and H are colored manually and can change with each use.

If it helps, we just need something that we can apply to each key column individually in order to evaluate each row and fill the key column we apply it to.

Thanks!

Is this the rule?
- cells containing any numeric value in columns B:E should be coloured to match F,G or H

Should cells with no value be coloured grey?

Is zero a "value" and coloured or "blank" and therefore "grey"?

How are F,G & H coloured - manually or by conditional formatting?

Are F,G & H always the filtering keys?
- ie your data is always 5 columns wide plus 3 filtering columns
 
Upvote 0
It looks like you are getting excellent productive help on the other (cross-posted) thread - and that you are close to a solution
When you have your solution, please complete this thread by posting that solution here.
thanks
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,011
Members
452,374
Latest member
keccles

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