J
JCO
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
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