我使用以下代码根据单元格值隐藏/取消隐藏某些形状。隐藏/显示正在工作,但形状作为链接工作,当我点击其中一些时,它只是改变并开始同时显示所有形状。 有没有更好的代码来做到这一点?
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$50" Then
'AAA
Shapes("XXX1").Visible = Target.Value = "ABC"
Shapes("XXX2").Visible = Target.Value = "ABC"
Shapes("XXX3").Visible = Target.Value = "ABC"
'BBB
Shapes("YYY1").Visible = Target.Value = "DEF"
'CCC
Shapes("ZZZ1").Visible = Target.Value = "GHI"
Shapes("ZZZ2").Visible = Target.Value = "GHI"
Shapes("ZZZ3").Visible = Target.Value = "GHI"
End If
End Sub