Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Change text color

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Change text color

You can do this with conditional formatting - no code needed

Format=Conditional formatting

--
Regards,
Tom Ogilvy

Mike Fogleman wrote in message
...
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Change text color

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" wrote in message
...
You can do this with conditional formatting - no code needed

Format=Conditional formatting

--
Regards,
Tom Ogilvy

Mike Fogleman wrote in message
...
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






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Change text color

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 wrote in message
...
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" wrote in message
...
You can do this with conditional formatting - no code needed

Format=Conditional formatting

--
Regards,
Tom Ogilvy

Mike Fogleman wrote in message
...
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








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Change text color

That worked! I was having trouble with set rng=.
"Tom Ogilvy" wrote in message
...
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 wrote in message
...
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" wrote in message
...
You can do this with conditional formatting - no code needed

Format=Conditional formatting

--
Regards,
Tom Ogilvy

Mike Fogleman wrote in message
...
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












Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
change color if text is = or not, to text in other column KittyLover New Users to Excel 7 June 2nd 09 02:36 AM
Can Text Function change output text color? epiekarc Excel Discussion (Misc queries) 1 December 31st 08 02:58 AM
Change text color Stanley Excel Discussion (Misc queries) 4 January 25th 06 02:52 PM
Change of text or background color doesn't change on the screen. Susan Excel Discussion (Misc queries) 5 July 29th 05 07:18 PM
Text Color Change Kim via OfficeKB.com Excel Worksheet Functions 3 March 11th 05 04:09 PM


All times are GMT +1. The time now is 03:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"