Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default In VBA Excel, how can I restore individual cells?

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default In VBA Excel, how can I restore individual cells?

Instead of:
CIBE_Cell.Interior.Color = &HFFFFFF
try:
CIBE_Cell.Interior.Color = xlNone
--
Gary''s Student - gsnu200740


"Richard" wrote:

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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default In VBA Excel, how can I restore individual cells?

Thanks! That works!

"Gary''s Student" wrote:

Instead of:
CIBE_Cell.Interior.Color = &HFFFFFF
try:
CIBE_Cell.Interior.Color = xlNone
--
Gary''s Student - gsnu200740


"Richard" wrote:

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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Locking individual cells in an excel spreadsheet sglassedmkw Excel Worksheet Functions 4 September 25th 08 10:39 PM
Locing individual cells In Excel Sheet from vb.net Karunaker Reddy Excel Worksheet Functions 0 December 5th 06 06:58 AM
Excel: Remove color background from cells, restore grid. tolstoi Excel Discussion (Misc queries) 2 November 26th 06 01:06 PM
How do I protect individual cells in Excel and not whole sheet? Angus Excel Discussion (Misc queries) 3 July 13th 06 09:58 AM
You should be able to lock individual Excel cells Jen Excel Worksheet Functions 3 May 6th 06 07:38 PM


All times are GMT +1. The time now is 10:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"