I am trying to write a simple formula that will give me the background color of a cell (in Excel). Something along the lines of, if background color is black, enter text from cell into another cell.
Does anyone have any suggestions?
I am trying to write a simple formula that will give me the background color of a cell (in Excel). Something along the lines of, if background color is black, enter text from cell into another cell.
Does anyone have any suggestions?
You have to use the Interior property of cells, and then, you can use either ColorIndex (To use one of the 56 "presets" colors in Excel) or Color, like this
ActiveCell.Interior.ColorIndex = 36
OR
Range("A1:A6").Interior.Color = RGB(200,160,35)
Hi
In C# i can set the backcolor of a cell like this
worksheet.get_Range("B1:B1", Type.Missing).Interior.ColorIndex = 1;
I need to set the color without using ColorIndex, ie any color using
Color.FromARGB(205, 255, 255)
I tried the following
worksheet.get_Range("B1:B1", Type.Missing).Interior.Color =
Color.FromARGB(205,255,255);
But it show an error. Does someone know how to acheve this.
Take a look at this from Microsoft. You most probably will find the answer.
Changing the Background Color of a Cell
You have to use the Interior property of the cell, and then:
You can use ColorIndex (to use one of the 56 "preset" colors in Excel):
Or you can use Color:Code:ActiveCell.Interior.ColorIndex = 36
Code:Range("A1:A6").Interior.Color = RGB(200,160,35)
Bookmarks