08-11-22 10:02 AM
08-11-22 12:46 PM
Dim range As Object
Dim currentCell As Object
Try
range = GetWorkbook(handle,Nothing).ActiveSheet.Range(startcell,endcell)
For Each currentCell In range
currentCell.Interior.Color = RGB(color_R, color_G, color_B)
Next currentCell
Catch ex As Exception
Finally
range = Nothing
End Try
Make sure to save your changes.
The above will give you a general action you can use to the set the background color of cells in a specific range. The color is based on RGB (Red, Green, Blue) values, so to set a cells background to red you would set ColorValue-R = 255 and the others to 0. Hopefully that makes sense.
This action doesn't account for the value criteria you mentioned though. You could either extend the code above the include a check of the cells value before changing the color, or you could just use Find action of the VBO to find all cells that have a value of Yes (or No) and use then iterate over the resulting Collection and call this new action on each of those cells.
Cheers,
08-11-22 03:48 PM
08-11-22 04:06 PM
08-11-22 06:29 PM