Zend certified PHP/Magento developer

Conditional Formatting starting and ending based upon cell values in a range

In a given range of x by y cells, I’m looking for a formula that will format cells in a row starting every time a cell value is “x” and ending every time a cell value anywhere in the range is “x”.

Here is an example of what I’d want it to look like:

enter image description here

The colors are not important. They can all be the same color, but just so they are formatted. So you can see, I have an x in B3, I want to format until I have an x in F4, and again until I have an x in H10. And it should be row based as in the image, but within a range, as I will want apply this same logic to multiple ranges on the same page. I hope this helps make it clear what I am after.