ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Precisely reposition a graphic (https://www.excelbanter.com/excel-programming/305072-precisely-reposition-graphic.html)

quartz

Precisely reposition a graphic
 
Hello.

I have a graphical object on a sheet and it is selected.
I need to move this object so that the top left corner of
the object is EXACTLY on the top left corner of cell "B2".

My code so far:

Dim objShape As Shape
Set objShape = ActiveSheet.Shapes(strSnapShotName)

objShape.?????

Please fill in what I need to do...thanks much in advance.

Dave Peterson[_3_]

Precisely reposition a graphic
 
This worked for me:

Option Explicit
Sub testme01()
Dim objShape As Shape
With ActiveSheet
Set objShape = .Shapes(1) 'changed for testing!
With .Range("b2")
objShape.Top = .Top
objShape.Left = .Left
End With
End With
End Sub




quartz wrote:

Hello.

I have a graphical object on a sheet and it is selected.
I need to move this object so that the top left corner of
the object is EXACTLY on the top left corner of cell "B2".

My code so far:

Dim objShape As Shape
Set objShape = ActiveSheet.Shapes(strSnapShotName)

objShape.?????

Please fill in what I need to do...thanks much in advance.


--

Dave Peterson



All times are GMT +1. The time now is 06:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com