Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Extremely easy question.

Posted on 2004-09-30
2
Medium Priority
?
217 Views
Last Modified: 2010-05-02
I am calculating ratings thru VB6.  I opened an excel worksheet, and as I am filling in the information, if a rating is higher than a target I want to fill that cells backcolor green, if lower, I want it to be red.  

I have been fighting this for a bit, and don't have the patience to look any longer.  Any help would be greatly appreciated.  Therefore, even though I know it is easy, I am giving 125 points instead of 50.

TIA,
DMM
0
Comment
Question by:dmmorse
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 32

Accepted Solution

by:
Erick37 earned 500 total points
ID: 12193107
A couple ways:

Sheet1.Range("A1:A1").Interior.Color = vbGreen
=or=
ActiveCell.Interior.Color = vbRed
0
 
LVL 5

Expert Comment

by:jmacmicking
ID: 12193554
Another option; Excel supports conditional formating.  If the target is fixed you can just set this for the whole column and let Excel do the grunt work.  The version of Excel I'm using (2002) has Conditional Formating listed under the Format menu.  If you've got an existing workbook just set it there and forget it.  If you're creating the workbook on the fly lemme know and I can lookup the appropriate object (or just use Erick37's suggestion, above)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

647 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question