macro to highlight precedent cells that contribute to a count in a countif formula cell

cbauducco

New Member
Joined
Feb 1, 2016
Messages
1
Hi everyone, What I want is to be able to click on a cell that has a countif formula, and then it be able to highlight all cells that contribute to the countif answer. I want it to be an automatic macro so that when I click on the cell with the formula, all the cells that apply to the countif that is shown in my list will highlight.

For example, if I have the following formula in a cell: =COUNTIFS($D$4:$D$32,"a",$H$4:$H$32,"b+")

and in my D column I have a list of grades and in my H column I have another list of grades. My countif formula will tell me how many kids went from an A grade to a B grade from D column (1st quarter) to H column(2nd quarter). Now what I would like is for the macro to highlight those cells that are contributing to the tally shown in my formula cell.

I tried using a "track formula precedents"(or whatever it is called, I do not have excel open right now to look at the exact name), but it highlights the entire range d4:d32 and H4:H32. I don't want the entire range highlighted, I want to highlight and show the cells that contrubute to the count.

I hope this makes sense and I hope someone has the answer. PLEASE HELP!
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,223,236
Messages
6,170,906
Members
452,366
Latest member
TePunaBloke

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