Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Moving Shapes within VBA

I know you can nudge shapes X pixels or what have you, but is there a
way to set the image to a home position... IE position it in the top
left corner so I can know how far to move it OR position the image
relative to other images already in place?

Thank you,

Jimmy

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Moving Shapes within VBA

Picture names are had to get. but this code works when there is only one
picture on a worksheet

Sub moveshape()

For Each myshape In ActiveSheet.Shapes
myleft = myshape.Left
myRight = myshape.Top
msgbox("Picture Name = " & myshape.name)
myshape.Left = myleft + 10
myshape.Top = mytop + 10
Next myshape
End Sub

Method 2

Sub moveshape1()
With ActiveSheet.Shapes("Picture 1")
myleft = .Left
myRight = .Top

.Left = myleft + 10
.Top = mytop + 10
End With
End Sub



"Juan Schwartz" wrote:

I know you can nudge shapes X pixels or what have you, but is there a
way to set the image to a home position... IE position it in the top
left corner so I can know how far to move it OR position the image
relative to other images already in place?

Thank you,

Jimmy


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Moving Shapes within VBA

On Aug 20, 11:02 am, Juan Schwartz wrote:
I know you can nudge shapes X pixels or what have you, but is there a
way to set the image to a home position... IE position it in the top
left corner so I can know how far to move it OR position the image
relative to other images already in place?

Thank you,

Jimmy


Anybody?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Moving Shapes within VBA

You can use the 1st program to get all the picture names, then use the 2nd to
move the pictures. You just have to figure out which name goes with which
picture.
You can put the locations in a message box, then the picture with the
smallest top dimension and smallest left dimension is the one on the top left
of the worksheet. Then continue doing this for each picture.

"Juan Schwartz" wrote:

On Aug 20, 11:02 am, Juan Schwartz wrote:
I know you can nudge shapes X pixels or what have you, but is there a
way to set the image to a home position... IE position it in the top
left corner so I can know how far to move it OR position the image
relative to other images already in place?

Thank you,

Jimmy


Anybody?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving Shapes Preschool Mike Excel Discussion (Misc queries) 3 April 16th 10 10:45 PM
inserted shapes keep moving Stephid707 Excel Discussion (Misc queries) 1 February 16th 09 05:37 PM
Shapes and Arrows Moving dpparman Excel Discussion (Misc queries) 1 August 20th 08 01:04 AM
Moving shapes with the mouse NickHK Excel Programming 1 August 14th 06 11:30 AM
Moving Shapes with the mouse pan65 New Users to Excel 0 August 13th 06 06:35 AM


All times are GMT +1. The time now is 12:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"