Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 49948

[SOLVED] Store RGB(x, y, z) As Variable

$
0
0
Hello,

I have a sub procedure that uses a color as an argument (ie RGB(0, 0, 0)), and then colors the selected cells:

Code:

Sub Shade_Cell(shadeColor As String)
With Selection.Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .Color = shadeColor
        .TintAndShade = 0
        .PatternTintAndShade = 0
End With
End Sub

I am given a mismatch error. I know it's possible to store shadeColor As Integer and then use 123456 as a color, but I was hoping I could use RGB instead as it makes more sense.

Thanks

Viewing all articles
Browse latest Browse all 49948

Trending Articles