Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Gridlines Inadvertently Goes Away with Macro
Okay but that would print when you turn grids off for printing?
After rethinking this, I may not need to do that at all. When a cell is filled, I'm thinking the lines are suppose to match that color. Something I was not doing before. You can't see or tell the colors of the Cell lines, therefore, I'm thinking it's not an issue. Unless anyone else knows better? thanks "GS" wrote in message ... 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Gridlines Inadvertently Goes Away with Macro
After serious thinking JCO wrote :
Okay but that would print when you turn grids off for printing? If you use Conditional Formatting to apply the dotted borders then you can also switch these off for printing. All you need is a cell to contain the switch 'flag' so you can toggle it how you want to view/print your data. -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Gridlines are there, then Custom View, gridlines disappear in xl 2 | Excel Discussion (Misc queries) | |||
not all the gridlines print; despite selecting/"gridlines" | Excel Discussion (Misc queries) | |||
Row colors overlay the gridlines...how do I show gridlines? | Excel Discussion (Misc queries) | |||
In Excel, gridlines won't print--File,PageSetup,Sheet,Gridlines-- | New Users to Excel | |||
Where are my gridlines? | Excel Worksheet Functions |