Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If this is the wrong place to ask this let me know.

Here is the formula I have right now:

=LEN($A$2)>$AB$11

Applies to:

=$A$2

That works great for the one cell. I need it to apply to each cell in the column.

If it was C# I would do something like this:

foreach(cell in columnA)
{
   if(cell.text.length > (INT)$AB$11.text)
   {
      cell.format(red)
   }
}

In other words how do I format each cell in column FOO if the len() of the cell value is longer then BAR?

share|improve this question
    
This looks like something for stackoverflow, if you ask me... –  marcusw Dec 16 '09 at 22:14
    
Yeah I don't know. If I found this question on SO I would say it belongs somewhere else. Where I'm not sure. –  NitroxDM Dec 17 '09 at 4:39
add comment

1 Answer

up vote 2 down vote accepted

If you need to generate the formatting programmatically for a large number of cells, you can do it with a macro (VBA), but if you're just looking for a quick and easy solution, you can drop the $'s from your original formula and copy and paste. In other words:

=LEN(A2)>$AB$11

Applies to A2, but if you copy and paste that into, say, B3, from B2 (that is to say, one cell down from the original), it will update itself to be this:

=LEN(A3)>$AB$11

You can paste across a large range of cells and it will update all of them. References without dollar signs are relative references, and will be updated in a copy/paste; references with dollar signs are absolute. I'm presuming, by the way, that AB11 holds a certain parameter you want to compare all cells to. If you're comparing them all to the single value, leave the dollar signs in that reference. If you're comparing a column to another column, relative references can do that for you too like this:

=LEN(A2)>$AB11

share|improve this answer
    
Gotcha. Here is what is odd... Formula: =LEN(A2)>$AB$11 Applies to: =$A$2:$A$88 Does exactly what I need. I'm just not sure how. There is some odd automagic going on here. –  NitroxDM Dec 17 '09 at 4:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.