Conditional Formatting Specific Values in a Cell

ststern45

Well-known Member
Joined
Sep 17, 2005
Messages
974
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Good day everyone,

I would like to as if there is a way to format a range of cell based on a specific value a user selects.

For example, I have 120 cell that contain values. I want to use the 6-7-7 and highlight any cells that match 6-7-7
If a cell contains 2-6-7-7 I would like to highlight this cell
If a cell contains 5-2-2-0-3-6-6-7 I would like to highlight this cell.
If a cell contains 6-6-7-0-5-3-2 I would like to highlight this cell.
I'm not sure if this is possible but only highlight the values 6-7-7.

Thank you in advance
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
I think you have an error in your description/examples.
Either that, or it isn't quite clear how you want this to work.

Your condition:
highlight any cells that match 6-7-7

Last two examples:
If a cell contains 5-2-2-0-3-6-6-7 I would like to highlight this cell.
If a cell contains 6-6-7-0-5-3-2 I would like to highlight this cell.
These last two examples only have one instance of "7" each, where you rule seems to indicate that they should have two.
Under that rule, it would appear that these two examples should NOT be highlighted.

So what that just a mistake, or do the rules need to be clarified more?
 
Upvote 0
I dont think you can format portions of contents inside cells with CF. Maybe in VBA you can.
But here is formatting cells that contain a number you can change:

Book1
ABC
1677
2
3677TRUE
41018FALSE
51020FALSE
61026FALSE
71096FALSE
81137FALSE
91145FALSE
101150FALSE
111157FALSE
121173FALSE
131186FALSE
141198FALSE
1556777TRUE
1656778TRUE
17106778TRUE
18126773TRUE
19126779TRUE
20156771TRUE
21367710TRUE
22467716TRUE
23467719TRUE
24567711TRUE
256771313TRUE
Sheet3
Cell Formulas
RangeFormula
B3:B25B3=ISNUMBER(SEARCH($C$1,TEXT(A3,0)))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A3:A25Expression=ISNUMBER(SEARCH($C$1,TEXT(A3,0)))textNO


Book1
ABC
196
2
3677FALSE
41018FALSE
51020FALSE
61026FALSE
71096TRUE
81137FALSE
91145FALSE
101150FALSE
111157FALSE
121173FALSE
131186FALSE
141198FALSE
1556777FALSE
1656778FALSE
17106778FALSE
18126773FALSE
19126779FALSE
20156771FALSE
21367710FALSE
22467716FALSE
23467719FALSE
24567711FALSE
256771313FALSE
Sheet3
Cell Formulas
RangeFormula
B3:B25B3=ISNUMBER(SEARCH($C$1,TEXT(A3,0)))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A3:A25Expression=ISNUMBER(SEARCH($C$1,TEXT(A3,0)))textNO
 
Upvote 0
I'm taking the dashes seriously, and assuming you don't want to find 6-6-70

MrExcelPlayground22.xlsx
A
22-6-7-7
35-2-2-0-3-6-7-7
45-6-6-70
516-6-7
66-7-7-0-5-3-2
79-5-2-4
Sheet25
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A7Expression=ISNUMBER(SEARCH("-6-7-7-","-"&A2&"-"))textNO
 
Upvote 0
Solution
Thank you everyone for your help. Each example worked. James your post has the dashes which I also use but I think the ideal solution may be to remove the dashes from my cells.
Thank you
Steve
 
Upvote 0
Thank you everyone for your help. Each example worked. James your post has the dashes which I also use but I think the ideal solution may be to remove the dashes from my cells.
Thank you
Steve
You wrote in the question:
I would like to as if there is a way to format a range of cell based on a specific value a user selects.
I thought you wanted a user to select the value that is searched? Post#4 does not provide that flexibility.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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