title: Hide/unhide shapes in Excel using VBA
body: <p><img src="https://i.stack.imgur.com/JI4JQ.png" alt="enter image description here"></p>
  
  <p>I have 3 shapes named oval 1, oval 2 and oval 3 and I need to hide/unhide that shapes according to a value calculated from "A1" where the resulted values are 10, 20 and 30 and when oval 1 = 10, oval 2 = 20 and oval 3 = 30. The image show an error box. How I do this?</p>
  
  <pre><code>Private sub worksheet_change(byval target as range)
  
       If target.row = 1 and target.column = 1 then
            Me.shapes("Oval 1").Visible = (Cells(1, 1).Value = 10)
  
       If target.row = 1 and target.column = 1 then
            Me.shapes("Oval 2").Visible = (Cells(1, 1).Value = 20)
  
       If target.row = 1 and target.column = 1 then
            Me.shapes("Oval 3").Visible = (Cells(1, 1).Value = 30)
  End sub
  </code></pre>