• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Can we identify position of image

ThrottleWorks

Excel Ninja
Hi,

I have a worksheet. This sheet has multiple pictures in it.
I want all the pictures to be visible from column A.
At present, these pictures might be visible from Column D or Column E.

How do I identify, if the picture is located at Column D and move it to column A.
Can anyone please help me in this.
 
Something like this.

Code:
Sub test()
Dim img As Shape

For Each img In ThisWorkbook.Sheets("Sheet1").Shapes
    If img.TopLeftCell.Column > 1 And img.Type = msoPicture Then
        img.Left = Columns(1).Left
    End If
Next img

End Sub

You don't need to check for type if all shapes are pictures in the sheet.
Alternately if image should align with left edge of worksheet, you can check for img.Left <> 0 and set it to 0.
 
Back
Top