Reputation: 53
I am trying to change the color of multiple shapes based off a table on another tab. The table contains part, quadrant, shape name, and value (cell with specific color.) I am trying to tie the shape to the color by using shape name and range of where the color cell is but I get a sub/function not defined. The colors for the values in the table is based off a conditional format.
Sub Update()
Dim CellColor As Long
Dim ShapeColor As Variant
CellColor = Worksheets("Sheet1").Range("D2").DisplayFormat.Interior.Color
ShapeColor = Worksheets("Sheet1").Range("C2").Value
Worksheets("main").Shapes(ShapeColor).Fill.ForeColor.RGB = CellColor
Worksheets("main").Select
End Sub
Upvotes: 0
Views: 731
Reputation: 50008
Moving my comments to an answer:
Set
should not be used here. Worksheet("main")
is missing an s - Worksheets
.Worksheets("Sheet1").Range("D2").DisplayFormat.Interior.Color
.Upvotes: 1