Hi Lewis,
I ended up solving my problem with this:
R = Application.WorksheetFunction.VLookup(Draw_Start_Cell.Offset(counter, i + 1).Value, rng, 3, False)
G = Application.WorksheetFunction.VLookup(Draw_Start_Cell.Offset(counter, i + 1).Value, rng, 4, False)
B = Application.WorksheetFunction.VLookup(Draw_Start_Cell.Offset(counter, i + 1).Value, rng, 5, False)
On Error Resume Next
Set shp = ActiveSheet.Shapes(Draw_Start_Cell.Offset(counter, i).Value)
On Error GoTo Skip
With shp
If InStr(1, shp.Name, "Sq", 1) Then
.Fill.ForeColor.RGB = RGB(R, G, B)
ElseIf InStr(1, shp.Name, "Tri", 1) Then
.Fill.ForeColor.RGB = RGB(R, G, B)
.Line.ForeColor.RGB = RGB(R, G, B)
ElseIf InStr(1, shp.Name, "Cir", 1) Then
.Fill.ForeColor.RGB = RGB(R, G, B)
Else
.Line.ForeColor.RGB = RGB(R, G, B)
End If
End With
I make sure each shape for a square has a "Sq" in it, circle names with a "Cir" in it etc. This way it will know which requires a fill colour change and which requires a line colour change, or in the case of triangles both.
Not sure if it is the most efficient way but works fine for my purposes.
Thanks for your code and sorry I didn't mark this as solved sooner!
Marcus
Bookmarks