TheAceMan1
Programmer
Howdy All ... Excel 2010
While troubleshooting a workbook I ran across an instance of a cells backcolor being changed from light red to white. During a break point I couldn't help but notice that the change removed the borders! ... I didn't notice it eariler because I format the borders sometime later in the code. The line of code that executes the change is:
Range("B2").Interior.Color = RGB(255, 255, 255)
Pretty straight forward stuff. Intrigued by this I checked sheets in other workbooks where I change the back color of cells (interior.color). Typically I'm just running an alternate backcolor scheme using conditional formatting. Setting a break point after the conditional formatting, reveals the borders are intact.
This is not a big deal and is easily corrected. I'd just really like to know why it happens.
Anyone have any idea/info why the borders are wiped out?
Note: you can see the effect by ececuting the line of code above on any cell (don't forget to change the cell reference) in a workbook.
See Ya . . .
Be sure to see FAQ219-2884 Worthy Reading!
Also FAQ181-2886 Worthy Reading!
While troubleshooting a workbook I ran across an instance of a cells backcolor being changed from light red to white. During a break point I couldn't help but notice that the change removed the borders! ... I didn't notice it eariler because I format the borders sometime later in the code. The line of code that executes the change is:
Range("B2").Interior.Color = RGB(255, 255, 255)
Pretty straight forward stuff. Intrigued by this I checked sheets in other workbooks where I change the back color of cells (interior.color). Typically I'm just running an alternate backcolor scheme using conditional formatting. Setting a break point after the conditional formatting, reveals the borders are intact.
This is not a big deal and is easily corrected. I'd just really like to know why it happens.
Anyone have any idea/info why the borders are wiped out?
Note: you can see the effect by ececuting the line of code above on any cell (don't forget to change the cell reference) in a workbook.
See Ya . . .
Be sure to see FAQ219-2884 Worthy Reading!
Also FAQ181-2886 Worthy Reading!