LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default GridLines Inadvertantly Goes Away with Macro

JCO expressed precisely :
I have a Macro that does several things including getting the Cell
Background Fill, store it, do some work, then restore the Cell
Background Fill. However, when doing this, the Cell Gridlines are
gone. I understand I can set the Background Fill to "No Color" to
restore this, but that would defeat the purpose of restoring the
color as mentioned earlier.

Code snip below:
' Change Cell Background Color
'
Dim vCellBackgroundFill As Variant 'store color
Dim vCellBackgroundNoFill As Variant 'store background grid

vCellBackgroundFill = Selection.Interior.Color

' Do other work here

With Selection.Interior
.Color = vCellBackgroundFill 'restore background
fill to original color
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.TintAndShade = 0
.PatternTintAndShade = 0
End With

Thanks for your help


Gridlines only display when cells have no .Interior.Color! You can,
however, simulate gridlines by giving cells with color a dotted line
border.<g

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


 
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
Gridlines are there, then Custom View, gridlines disappear in xl 2 Winnipeg Michael Excel Discussion (Misc queries) 0 September 15th 08 06:04 PM
not all the gridlines print; despite selecting/"gridlines" suewholovesbirds Excel Discussion (Misc queries) 1 October 23rd 06 09:33 PM
Row colors overlay the gridlines...how do I show gridlines? RickToo11 Excel Discussion (Misc queries) 2 September 13th 06 03:46 PM
In Excel, gridlines won't print--File,PageSetup,Sheet,Gridlines-- 4most New Users to Excel 3 July 9th 06 01:45 AM
Where are my gridlines? Badger Excel Worksheet Functions 2 January 5th 06 05:42 PM


All times are GMT +1. The time now is 01:15 AM.

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

About Us

"It's about Microsoft Excel"