Hi,

Bit of a theory based question here.

I have a row of four cells and I want to run some code only if two of these cells are not blank.
The only possible outcomes are:
  • all cells empty
  • all but one cell empty
  • all but two cells empty

Obviously I could build a messy if statement using Or's and And's to check for each of the possible possitive criteria matches (e.g: If A1 and B1 <> "" or A1 and C1 <>"" or A1 and D1 <>"" or B1 and C1 <>""... etc), but I was wondering if there's a neater way to do this...

Always looking to improve, any ideas appreciated.

Thanks, TC