relation between cell and picture which is above it.

G

Guest

in my sheet there is one column called 'picture', and many picture are in
cells belongs to this column.
my problem is that, i know picture is just floating on the sheet, it doesn't
belong to any cell. But, i need get the picture which is above certain cell.
so i need know the relation between one cell and picture which above this
cell.
in my sheet, the cell size is bigger than picture.so the picture is totally
in the cell.
 
J

Jim Rech

Sub a()
Dim Pic As Shape
For Each Pic In ActiveSheet.Shapes
If Pic.TopLeftCell.Address(False, False) = "D9" Then
MsgBox Pic.Name
Exit For
End If
Next
End Sub

This assumes there are no other shapes in the same cell as the picture.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top