Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default set font color depending on value Range

greetings,
simple question (I think). Many thanks for any input on this.

Is there a way using Range to set cells to either red or green
depending on whether they are 5% (red), or less (green). I'm on
office 2003.

I'm currently doing this using the looping logic and that's pretty
slow. I'm hoping the range option will be faster.

If Excel.Range(ActiveCell.Offset(1, 110), _
ActiveCell.Offset(1, 1)).Value = 0.05 Then

Excel.Range(ActiveCell.Offset(1, 110), _
ActiveCell.Offset(1, 110)).Font.ColorIndex = 3

Else
Excel.Range(ActiveCell.Offset(1, 110), _
ActiveCell.Offset(1, 110)).Font.ColorIndex = 10
End If

regards,
CG
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,104
Default set font color depending on value Range

Have you thought of using conditional formatting as built into Excel?
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email


"LetMeDoIt" wrote in message
...
greetings,
simple question (I think). Many thanks for any input on this.

Is there a way using Range to set cells to either red or green
depending on whether they are 5% (red), or less (green). I'm on
office 2003.

I'm currently doing this using the looping logic and that's pretty
slow. I'm hoping the range option will be faster.

If Excel.Range(ActiveCell.Offset(1, 110), _
ActiveCell.Offset(1, 1)).Value = 0.05 Then

Excel.Range(ActiveCell.Offset(1, 110), _
ActiveCell.Offset(1, 110)).Font.ColorIndex = 3

Else
Excel.Range(ActiveCell.Offset(1, 110), _
ActiveCell.Offset(1, 110)).Font.ColorIndex = 10
End If

regards,
CG



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default set font color depending on value Range

hhhmmm not sure how conditional setup would be setup in VBA. The
sheets I need to do this are dynamically created.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default set font color depending on value Range

thanks for the tip, I looked up conditional formatting. I think I'm
ok from here.

regards,
CG
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,104
Default set font color depending on value Range

This might help
http://www.ozgrid.com/VBA/excel-cond...ting-limit.htm

--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email


"LetMeDoIt" wrote in message
...
thanks for the tip, I looked up conditional formatting. I think I'm
ok from here.

regards,
CG



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 font color depending on cell value Mickey Excel Worksheet Functions 12 October 1st 08 01:41 AM
Extracting font color within a range Barb Reinhardt Excel Programming 3 May 7th 07 11:43 PM
conditional depending on font color help? [email protected] Excel Programming 1 August 15th 06 11:33 PM
How do I get the font color to change automatically depending on gtcarlsbad Excel Discussion (Misc queries) 2 February 1st 05 02:39 AM
font color depending upon value possible? DrB Excel Programming 9 November 25th 04 05:15 PM


All times are GMT +1. The time now is 10:50 AM.

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

About Us

"It's about Microsoft Excel"