How do i select an inserted image.

S

SpeeD

Hi.

I need to select an allready inserted image and align it to a cell, But i
can´t make my code works.
What am i doing wrong???

Thansk in advance
SpeeD

Dim myPict As Picture
With ActiveSheet.Range("p2")
Set myPict = ActiveSheet.Shapes("Picture18")
myPict.Top = .Top
myPict.Left = .Left - 50
myPict.Placement = xlMove
End With
 
S

SpeeD

Please ignore this post. It´s duplicated due to the Posting system incorrect
ERROR messege.

SpeeD
 
S

SpeeD

Please ignore this post. It´s duplicated due to the Posting system incorrect
ERROR messege.

SpeeD
 
M

Mike H

Hi,

Try this

Note by default Excel wil put a space in Picture 18 and if your picture has
that then so must the code.

Dim myPict As Picture
With ActiveSheet.Range("P2")
Set myPict = .Parent.Pictures("Picture18")
myPict.Top = .Top
myPict.Left = .Left - 50
myPict.Placement = xlMoveAndSize
End With


Mike
 

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