Solved

Can I automatically set a cell color in an Excel spreadsheet using VB6?

Posted on 2006-06-28
2
376 Views
Last Modified: 2011-09-20
I test contents of the field values in a recordset.  The records are written out to an Excel spreadsheet . I want to be able to set cell color based on the results of the test. I can easily create and populate the worksheet but do not see a way to set the cell color. While a solution is desired, a definitive "can't do that" will earn the points.
0
Comment
Question by:rkulp
[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 20

Accepted Solution

by:
hes earned 125 total points
ID: 17001638
Try
objSpreadsheet.Cells(1,1).Interior.Color = RGB(229,229,231)
' or whatever you have your spreadsheet called or
objSpreadsheet.Cells(1,1).Interior.Color = vbRed
0
 
LVL 1

Author Comment

by:rkulp
ID: 17001695
Thank you.  Works like a champ.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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…

733 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