The title may be typically simple, but I did not get a solution yet even after researching over several forums on the net.
Let me explain the problem.
I have an excel workbook where few columns uses if conditions that refers other cells. Based on the cell's content, the back color of the cell is defined. For eg. If a cell is blank, it automatically changes to red. These red cells indicates missing information. So I am trying to design a macro to identify these red cells and get the address of each red cell.
For this I used the code for testing, MsgBox IIf(ActiveCell.Interior.ColorIndex = 3, "Yes", "No")
But this does not work. The reason is, the macro identifies the color index as -4142 irrespective of what color it is. Whether it is white or blue or red, it still shows -4142.
When I asked this question in a forum, I was redirected to this page.
http://www.cpearson.com/excel/CFColors.htm
I tested the functions given in that page. It works fine for the sample workbooks I created. But not in the workbook that I am trying to validate.
Could you please help me?
See Question&Answers more detail:os