Conditional Formatting cells that contain matching strings of text

ksjohnson86

New Member
Joined
Aug 10, 2023
Messages
3
Office Version
  1. 365
Platform
  1. MacOS
I have a range of cells that currently are conditionally formatted to turn any cells within the same row yellow with dark yellow text if they have duplicate values. However, I also want them to turn yellow if they have matching strings of text. Specifically, each cell can have a single number value, or it can contain a string of numbers formatted as "/x/y/z/". For example, cell B2 might have "12" and cell D2 might have "/4/22/12/16/".
I've successfully used the SEARCH function to capture these "/x/" strings for other tracking functions in this workbook. But the problem is when I try to use it in a formula for conditional formatting and apply it to an array of cells, I inevitably end up self-referencing and I get an error message. Any ideas for accomplishing this using VBA? Or a formula to use in conditional formatting that doesn't end up self-referential?

Thanks!
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
To clarify the example above, I'd want cell B2 and D2 to be yellow because they both contain "12" ; I need to find a way to account for the "/" delimiter around the matching numbers in the conditional formatting formula or VBA code.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,217
Members
452,619
Latest member
Shiv1198

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