Conditional Formatting to color a cell if Offset 1 to the right of ActiveCell contains "XYZ"

2Took

Board Regular
Joined
Jun 13, 2022
Messages
203
Office Version
  1. 365
Platform
  1. Windows
Trying to get if not a solution, then thoughts on this endeavor:

To get a cell A formatted, if Offset 1 B to the right of ActiveCell C contains "XYZ".

A, B & C is to indicate three sells would be involved:
A is acted upon by Conditional Formatting,
B is cell evaluated if its value contains "XYZ", and
C is currently ActiveCell - as in one currently selected.

VBA solution is also welcome, but really curious about Conditional Formatting solution.
Or maybe a combo of the two?
 
To get a cell A formatted, if Offset 1 B to the right of ActiveCell C contains "XYZ".

Solved as follows:

In Worksheet Selection Change:

VBA Code:
Range("L1").Value = ActiveCell.Address

Then for cell A, Conditional Formatting formula:

=COUNTIF(OFFSET(INDIRECT(L1,TRUE),0,1),"*XYZ*")

Put "XYZ" one cell to the right of cell you want to trigger A cell to be formatted.
 
Upvote 0
Solution

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

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