Quantcast
Channel: Microsoft Community - Super Fresh
Viewing all articles
Browse latest Browse all 1237235

Macro to run without changing the cell color

$
0
0

Hello,

I created two macros (see code below), one to shade selected cells with slashes and the other to remove the slashes.  Some cells are colored in orange, which I want to keep, whether there are slashes or not.  When I record the macros, the orange coloring is maintained, but when I run the macros, it's eliminated.  Is there a command I can insert in the macros to prevent that from happening?   These macros will be used by different users, on cells they select.

Thank you,

Chris

Sub Shade_Completed()
'
' Shade_Completed Macro
' Shades cells selected by user for for completed calls.
'

'
    With Selection.Interior
        .Pattern = xlLightUp
        .PatternThemeColor = xlThemeColorDark1
        .ColorIndex = xlAutomatic
        .TintAndShade = 0
        .PatternTintAndShade = -0.349986266670736
    End With
End Sub
Sub Unshade_Cells()
'
' Unshade_Cells Macro
' Unshades selected cells.
'

'
    With Selection.Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .ColorIndex = xlAutomatic
        .TintAndShade = 0
        .PatternTintAndShade = 0
    End With
End Sub


Viewing all articles
Browse latest Browse all 1237235

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>