In VBA Excel, how can I restore individual cells?

G

Guest

In my VBA program, I fill individual cells with light green color using:
CIBE_Cell.Interior.Color = &HC0FFC0
and this works ok.

When I want to restore the cells to white, I set:
CIBE_Cell.Interior.Color = &HFFFFFF
and the fill color is reset to white.

But the borders of the cells are white and thus invisible. All the other
cells in the spreadsheet have their normal default light blue borders.


I tried to reset the borders in the program with
CIBE_Cell.Borders.LineStyle = xlContinuous
CIBE_Cell.Borders.Weight = xlHairline
CIBE_Cell.Borders.Color = xlLightBlue
but this makes the borders come out black and dotted - not light blue and
continuous.

I removed these 3 lines, and after running my program, the cells have the
white borders again instead of the standard light blue ones that all the
other cells have.

After the program ends I can reset the borders by going to the Fill menu and
selecting "No Fill". Notice this is NOT to the Borders menu & selecting "No
Border", because the white "border" is not considered by Excel to be a border!

How can I do this in my VBA program?
I've tried to set the GridLineColor property, but that gives errors because
it probably cannot be used to refer to single cells.
 
G

Guest

Instead of:
CIBE_Cell.Interior.Color = &HFFFFFF
try:
CIBE_Cell.Interior.Color = xlNone
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top