Conditional Format or Visual Basic Code

squeakums

Well-known Member
Joined
May 15, 2007
Messages
823
Office Version
  1. 365
I'm trying to write some sort of code to color a cells in (column A) based on these parameters - these are grouped by number. if any number group of numbers in column A have no real number assigned in column B (such as 0 or #n/a) then column that number in column A. If column B has a real number such as that 11965; then leave all of the numbers in column A uncolored. For example those in red below, but I want it to fill a color instead.

Conditional format or Visual basic code - how's it written?

Column A Column B
36 11965
36 0
36 #n/a
36 0
38 #n/a
38 0
38 0

40 112
40 0
40 #n/a
40 0
14 0
14 #n/a
14 #n/a
14 0
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
- Select the cells you want to format. eg A1:A15
- On the Home tab, in the Styles group, click Conditional formatting > New Rule…
- In the New Formatting Rule window, select Use a formula to determine which cells to format.
- Enter the formula in the corresponding box.

=COUNTIFS($A:A,A1,$B:B,">0")=0

- Click the Format… button to choose your custom format.
- click the OK button.
- click the OK button to save the rule
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,093
Latest member
dbomb1414

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