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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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