?
Solved

Extremely easy question.

Posted on 2004-09-30
2
Medium Priority
?
218 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
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

830 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