I want to color fill a range of cells dependent on position of 2 shapes.
This code works,
BUT I want to color a slightly large range; ie
Everything I have tried just so far is ending up with a Type mismatch 13 error
This code works,
VBA Code:
Public Sub Color_Shapes_Position()
Dim rng As Range
Dim rng1 As Range
Dim sTopLeft As Variant
Dim sBottomRight As Variant
sTopLeft = ActiveSheet.Shapes("Rounded Rectangle 180").TopLeftCell.Address
sBottomRight = ActiveSheet.Shapes("Rounded Rectangle 185").BottomRightCell.Address
Set rng1 = Range(Range(sTopLeft), Range(sBottomRight))
rng1.Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent6
.TintAndShade = 0.799981688894314
.PatternTintAndShade = 0
End With
End Sub
BUT I want to color a slightly large range; ie
VBA Code:
Set rng1 = Range(Range(sTopLeft -1), Range(sBottomRight +1))