Solved

# code or valadation to highlight cell yellow

Posted on 2011-10-11
350 Views
Last Modified: 2012-05-12
I want to highlight a cell if the following orrors:

if c5 = "" and c6 = something then highlight c5
and if c6 = "" and c5 = something then highlight c6

when there is 'something' in c5 and c6 OR there nothing in c5 and c6 then NO highlighting.

Hi experts,
I need to do this to multiple double cell throughout my sheet.

example attached:

Cheers

Rob.
Highlighting.xlsx
0
Question by:RobJanine
5 Comments

LVL 26

Accepted Solution

RobJanine,

Please see attached.

Conditional Formatting formula is ...
=OR(AND(MOD(ROW(),2)=1,D5="",D6<>""),AND(MOD(ROW(),2)=0,D5="",D4<>""))

Regards,
Brian. Highlighting-V2.xlsx
0

LVL 43

Expert Comment

Try this formula

=MOD(COUNTA(D5,OFFSET(D5,2*(MOD(ROW(),2)-0.5),0)),2)*(D5="")
0

LVL 26

Expert Comment

Please note, the formula is "row-sensitive". So, if it "starts" on an even-numbered row then the formula should be...
=OR(AND(MOD(ROW(),2)=0,D5="",D6<>""),AND(MOD(ROW(),2)=1,D5="",D4<>""))
0

Author Closing Comment

Works Great!!! Thanks
0

LVL 26

Expert Comment

Thanks, RobJanine!
0

## Join & Write a Comment Already a member? Login.

### Suggested Solutions

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

#### 734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

#### Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!