IF statement

G

Guest

Is it possible for an IF statement to check to see if a Cell is Highlighted
and if it is Highlighted (True) then do what ever I want. I want to go
through and add all the cell that are highlighted on my spreadsheet with a
formula so if I ever highlight new ones or un-highlight any if will change
the sum.
 
G

Guest

Short answer: No, not with an IF statement. IF cannot determine highlighted
property.
 
G

Guest

Not a function. You can do it with VBA and could develop a User Defined
Function from that. This question comes up quite often - seems maybe one of
these days such a feature should be added to Excel.

If you have used Conditional Formatting to get the cell highlighting, you
can use a helper cell/column to do it. You'd set up a test in the helper
cell that was pretty much the same type of test you did to do the conditional
formatting, and put a value in that helper cell to tell you whether the
source cell is shaded or not (0 = not shaded, 1 = shaded kind of thing).
Then you can do your math based on the contents of the helper cells.

If you're just highlighting/unhighlighting them manually, then VBA is about
the only way to attack it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top