LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
JCO JCO is offline
external usenet poster
 
Posts: 54
Default GridLines Inadvertantly Goes Away with Macro

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





 
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 11:31 PM.

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"