tj123
tj123

Reputation: 143

Modifying shape visability based on named cell

My code isn't working to modify shape visability ... can you help?

Have named a cell [test] and want a line callout shape to appear/ disappear based on a value in a cell. 1 = visable 0= not visable

Sub Macro1()
Dim ws As Worksheet
    With ws.Shapes.Range(Array("Line Callout 1 1"))
           .Fill.Visible = [test]
           .Line.Visible = [test]
    End With
End Sub

Upvotes: 0

Views: 25

Answers (1)

Imran Malek
Imran Malek

Reputation: 1719

Try this

Sub Macro1()
Dim ws As Worksheet

Set ws = ThisWorkbook.ActiveSheet
    With ws.Shapes.Range(Array("Line Callout 1 1"))
           .Fill.Visible = Range("test")
           .Line.Visible = Range("test")
    End With
End Sub

Upvotes: 1

Related Questions