title: Determine shape position with cell
body: <p>I have an Excel calendar in which certain cells have a shape on them. I wish to be able to see which cells have a shape and then be able to extract some data.
  I've searched a bit and found that the best option was to use TopLeftCell.Row but it seems there's an error on my code. I've copied a code and tried to adapt it, here it is:</p>
  
  <pre><code>Sub ActiveShapeMacro()
  
  Dim ActiveShape As Shape
  Dim UserSelection As Variant
  
  'Pull-in what is selected on screen
    Set UserSelection = ActiveWindow.Selection
  
  'Determine if selection is a shape
    On Error GoTo NoShapeSelected
      Set ActiveShape = ActiveSheet.Shapes(UserSelection.Name)
    On Error Resume Next
  
  'Do Something with your Shape variable
    Cells(Sheet1.Shapes(ActiveShape).TopLeftCell.Row, Sheet1.Shapes(ActiveShape).TopLeftCell.Column).Address
    MsgBox (ActiveShape.Address)
  
  Exit Sub
  
  'Error Handler
  NoShapeSelected:
    MsgBox "You do not have a shape selected!"
  
  
  End Sub
  </code></pre>
  
  <p>Thank you for your help! :)</p>