Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Change text color

11 views
Skip to first unread message

Mike Fogleman

unread,
Jan 17, 2004, 5:45:37 PM1/17/04
to
Hi, I have two columns of data B & K with same number of rows. Column K
values are the result of a cell formula. I want to change the text color of
B5 to red if it is less than K5. I have a variable named RowCount available
with the number of rows that are in the columns if that can be of any use.

TIA Mike


Tom Ogilvy

unread,
Jan 17, 2004, 6:04:42 PM1/17/04
to
You can do this with conditional formatting - no code needed

Format=>Conditional formatting

--
Regards,
Tom Ogilvy

Mike Fogleman <mikefo...@insightbb.com> wrote in message
news:ehOkiuU3...@TK2MSFTNGP11.phx.gbl...

Mike Fogleman

unread,
Jan 17, 2004, 6:17:13 PM1/17/04
to
Tom, I have fooled around with that, but I forgot to mention that Column K
will be deleted afterwards and I want the appropriate numbers in B to remain
Red. I could not get that to happen with Conditional Formatting.
I think I need a loop.
Mike
"Tom Ogilvy" <twog...@msn.com> wrote in message
news:100jfs3...@news.supernews.com...

Tom Ogilvy

unread,
Jan 17, 2004, 7:03:41 PM1/17/04
to
Dim rng as Range, cell as Range
set rng = Range(cells(1,2),cells(rows.count,2).end(xlup))
for each cell in rng
if cell.Value < cell.offset(0,9).Value then
cell.font.ColorIndex = 3
else
cell.font.ColorIndex = xlautomatic
end if
Next

--
Regards,
Tom Ogilvy

Mike Fogleman <mikefo...@insightbb.com> wrote in message

news:OVJINAV3...@TK2MSFTNGP11.phx.gbl...

Mike Fogleman

unread,
Jan 17, 2004, 11:31:58 PM1/17/04
to
That worked! I was having trouble with set rng=.

"Tom Ogilvy" <twog...@msn.com> wrote in message
news:100jjaj...@news.supernews.com...
0 new messages