ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   change Excel Cell forecolor using VB6 (https://www.excelbanter.com/excel-discussion-misc-queries/199114-change-excel-cell-forecolor-using-vb6.html)

Lennie

change Excel Cell forecolor using VB6
 
Hi there,

I am exporting data from ACCESS database to EXCEL Spreadsheet. If the Sales
value is below certain value, I like to forecolor for a specific row to be
RED in color.

Tried using this code in VB6 and it's not working:
objWorksheet.Cells(intRow, intCol).Fill.SchemeColor = vbcolor

Jarek Kujawa[_2_]

change Excel Cell forecolor using VB6
 

objWorksheet.Cells(intRow, intCol).Interior.ColorIndex = 5


Barb Reinhardt

change Excel Cell forecolor using VB6
 
I wonder if you might need to use the RGB Color scheme.
--
HTH,
Barb Reinhardt



"Lennie" wrote:

Hi there,

I am exporting data from ACCESS database to EXCEL Spreadsheet. If the Sales
value is below certain value, I like to forecolor for a specific row to be
RED in color.

Tried using this code in VB6 and it's not working:
objWorksheet.Cells(intRow, intCol).Fill.SchemeColor = vbcolor



All times are GMT +1. The time now is 07:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com