I can't seem to get any of the cells to change colors like I want. Here's what I'm trying to do. I am calculating the value of a certain row and then I want to examine that value to determine what color to use. Here's the code: col = 6 formula = "=IF(D6<> 0,E6/D6,0)" formula = replace(formula,"6",row) oXLW.Worksheets(1).Cells(row, col).Formula = formula ' -- Determine Color Formatting of cells for % Hrs Utilization
utilize = oXLW.Worksheets(1).Cells(row, col).Value
if (utilize >= .975 and utilize <= 1.025) then
oXLW.Worksheets(1).Cells(row, col).Interior.Color = 65536*204 + 256*255 +204
When I look at the spreadsheet, it is showing the formula for that cell when I highlight it but the value that is actually showing is a percentage. I'm attaching a snippet of the spreadsheet that is produced and what I'm trying to accomplish. Basically, I want the column F and column I to be formatted with the appropriate color based on the value in the cell.