0

I have an excel sheet that for the forseeable future will remain as a Work In Progress regarding a project. To easily be able to keep track of rows that need some work I would like to create a macro that changes the background color depending on certain rules, according to this pseudo-code:

For each row n {
  if any cell on row n contains a question mark, background of cell [A,n] should be red
  if cell [B,i] is empty, background of cell [A,n] should be red
}

What's the easiest way to implement above pseudo-code to rows 4 to, say... 1000?

Note regarding the question mark:

It may be a standalone question mark, or it will be text followed by a question mark. I want it to match any question mark on that row.

Note regarding rule precedence:

If both rules were to trigger on the same row, I want the cell to end up red.

1
  • @Ramhound Nor did I claim that you were. I am unable to find anywhere in excel 2013 where I can begin playing around with VBS or the like. What I have found is that the wizard style selection under Conditional Formatting leaves a lot to be desired, and the other choices don't seem to do anything near what I need.
    – Jarmund
    Jul 9, 2015 at 13:14

2 Answers 2

2

In Conditional Formatting, apply the formula =OR(B1="",MATCH("?",1:1,-1)>0) to column A.

The MATCH portion will look for a question mark anywhere in any field in the row, not just a standalone question mark.

1

Using this formula =OR(B1="",A1:C1="?") gave me results that would seem to be what you are looking for:

enter image description here

1
  • Sorry to have missed the part where you said that the "?" could be preceded by text. This formula accounts for that: =OR(B1="",OR(RIGHT(A1:C1,1)="?"))
    – Clif
    Jul 9, 2015 at 18:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .