Set cell colour - if numbers exist in a list

Asrampd

Board Regular
Joined
Feb 26, 2012
Messages
247
Each cell on my sheet has two numbers either side a "|" charactor (e.g. 5|123)

I am looking for a Macro that processes the range on sheet "Main" A1:C19 and sets each cell colour (say to Red), if the numbers don't appear in both Columns C & D

Listpoint

ABCD
1MNEMONICOSNPNTTYP
2========================
301A0003131CMD
401A00011102CMD
5100041128PRG
601R2601117CMD
701A0TIM1106TIM
801P0108174AI

<COLGROUP> <COL style="WIDTH: 30px; FONT-WEIGHT: bold"><COL style="WIDTH: 129px"><COL style="WIDTH: 35px"><COL style="WIDTH: 32px"><COL style="WIDTH: 36px"> </COLGROUP><TBODY>
</TBODY>


Excel tables to the web >> Excel Jeanie HTML 4


So that -

1|31, would be Ok
1|32 would be RED
1|102, would be Ok
1|128, would be Ok
etc.


The file is available at
https://www.dropbox.com/s/ow9j49y19bhi0wc/Book7_1.xlsm

Ta.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Asrampd,
This is not a macro, but it might help?
If you added a helper column (E) you could use this formula =iferror(if(find(b3:c3),"Yes",""),""). Then use this formula for conditional formatting for cells b3 & c3 =AND($E$3=""), set color to red.

<colgroup><col></colgroup><tbody>
</tbody>
 
Upvote 0
Thanks for the reply, I don't know if you saw the Workbook, it checks for the existance of the number sequence, e.g. 101|23 (on a different sheet) in two columns.

Ta.
 
Upvote 0

Forum statistics

Threads
1,214,590
Messages
6,120,421
Members
448,961
Latest member
nzskater

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