Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Changing cell fill color as result of 'if' statement

if expression then
' Red
Cell.Interior.ColorIndex = 3
else
' green
cell.Interior.colorIndex = 4
End if

You expression should be something that evaluates to True or False or not
zero (true) or zero (false).

--
Regards,
Tom Ogilvy


Stuart wrote in message
...
I have an if then else statement which will give one of
two results.
One of those results I would like to change the fill color
of the cell to red and the other result I want the cell to
be green.

How can I program this if statement so that it works?

Stuart



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
Changing result color Gene L. New Users to Excel 2 October 16th 09 05:12 AM
Fill Color If Statement Elgee Excel Worksheet Functions 3 August 5th 08 10:13 PM
Formatting color and font to a logical statement result? STRAC Excel Worksheet Functions 7 January 17th 08 09:52 PM
Changing the fill color of a cell cquintero57 Excel Discussion (Misc queries) 2 December 11th 07 04:20 PM
Changing cell fill color as result of 'if' statement Phobos Excel Programming 0 August 31st 03 12:41 PM


All times are GMT +1. The time now is 05:18 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"