Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Chaging the color of a cell acording to its value

I want a macro to change the color of a cel acording to its value. It cant be
done with conditional formating cause I have 4 ranges of values.

from 0% to 80% = black and white font
from 81% to 84% = red with white font
from 89% to 92% = yellow with black font
from 93% to 100% = green with white font

Someone can helpme??
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Chaging the color of a cell acording to its value

something like ....

SELECT CASE value
CASE <80
clr = 1
bck=2
CASE <84
clr = 1
bck = 3
etc
END SELECT

with target
..forecolor = clr
..interior.coplor = bck
end with






"Dani Lima" wrote:

I want a macro to change the color of a cel acording to its value. It cant be
done with conditional formating cause I have 4 ranges of values.

from 0% to 80% = black and white font
from 81% to 84% = red with white font
from 89% to 92% = yellow with black font
from 93% to 100% = green with white font

Someone can helpme??

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Chaging the color of a cell acording to its value


Dani Lima;221278 Wrote:
I want a macro to change the color of a cel acording to its value. It
cant be
done with conditional formating cause I have 4 ranges of values.

from 0% to 80% = black and white font
from 81% to 84% = red with white font
from 89% to 92% = yellow with black font
from 93% to 100% = green with white font

Someone can helpme??


Why not use CF?

Just make your default format one of the four ( say the first from 0%
to 80% = black and white font) and then apply the three other CF's
you will then only have conditions for

from 81% to 84% = red with white font
from 89% to 92% = yellow with black font
from 93% to 100% = green with white font

HTH


--
Pecoflyer

Cheers -
*'Membership is free' (http://www.thecodecage.com)* & allows file
upload -faster and better answers

*Adding your XL version* to your post helps finding solution faster
------------------------------------------------------------------------
Pecoflyer's Profile: http://www.thecodecage.com/forumz/member.php?userid=14
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=60981

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Chaging the color of a cell acording to its value

i suspect that he has sic CFs --- there are gaps in his numerical ranges

"Pecoflyer" wrote:


Dani Lima;221278 Wrote:
I want a macro to change the color of a cel acording to its value. It
cant be
done with conditional formating cause I have 4 ranges of values.

from 0% to 80% = black and white font
from 81% to 84% = red with white font
from 89% to 92% = yellow with black font
from 93% to 100% = green with white font

Someone can helpme??


Why not use CF?

Just make your default format one of the four ( say the first from 0%
to 80% = black and white font) and then apply the three other CF's
you will then only have conditions for

from 81% to 84% = red with white font
from 89% to 92% = yellow with black font
from 93% to 100% = green with white font

HTH


--
Pecoflyer

Cheers -
*'Membership is free' (http://www.thecodecage.com)* & allows file
upload -faster and better answers

*Adding your XL version* to your post helps finding solution faster
------------------------------------------------------------------------
Pecoflyer's Profile: http://www.thecodecage.com/forumz/member.php?userid=14
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=60981


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
Error after chaging file access in Office 2007 armaSANEA Excel Programming 0 April 21st 08 03:16 PM
Excel: Syntax to change cell color based on color of another cell davew18 Excel Worksheet Functions 1 January 4th 07 01:24 PM
I WANT DATA TO LINK WITH OTHER WORKBOOKS ACORDING TO CELL CONTENT. HUGO PIENAAR Excel Worksheet Functions 0 April 28th 06 02:45 PM
Can't format cell color/text color in Office Excel 2003 in files . albertaman Excel Discussion (Misc queries) 0 February 16th 06 03:56 AM
filling cells acording to the first 3 numbers pmarques Excel Discussion (Misc queries) 1 September 9th 05 12:31 PM


All times are GMT +1. The time now is 11:54 PM.

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"