I don't have a guess why it's not working for you--do you have other shapes in
that activesheet that might confuse excel?
Maybe going through the shapes collection would work better:
Option Explicit
Sub Macro4()
'
' Macro4 Macro
'
Dim myCell As Range
Dim myShape As Shape
Dim FoundIt As Boolean
With ActiveSheet
Set myCell = .Range("D12") 'or something
For Each myShape In .Shapes
If myShape.TopLeftCell.Address = myCell.Address Then
FoundIt = True
Exit For
End If
Next myShape
End With
If FoundIt = True Then
myShape.Select
Else
MsgBox "No pictures found!"
End If
End Sub
OK this is it:
At the time that I run this macro the cell cursor has a picture in it
at Range("D12")
Sub Macro4()
'
' Macro4 Macro
'
Dim myCell As Range
Dim myPict As Picture
Dim FoundIt As Boolean
With ActiveSheet
Set myCell = .Range("D12") 'or something
For Each myPict In .Pictures
If myPict.TopLeftCell.Address = myCell.Address Then
FoundIt = True
Exit For
End If
Next myPict
End With
If FoundIt = True Then
myPict.Select
Else
MsgBox "No pictures found!"
End If
End Sub