I require a macro to enable a selected shape to be moved from current cell location to relative position but 1 row up.
eg topleft address = A4 and shift shape to topleft address = A3
I require a macro to enable a selected shape to be moved from current cell location to relative position but 1 row up.
eg topleft address = A4 and shift shape to topleft address = A3
Last edited by wotadude; 11-12-2008 at 05:56 PM.
Plz select shape first, then RUN macro (best way assign shorcut key tothe macro)
PHP Code:
Sub MoveShape()
On Error Resume Next
Dim Poce As Range
With ActiveWindow.Selection.ShapeRange(1)
Set Poce = .TopLeftCell
.Top = Poce.Offset(-1, 0).Top
.Left = Poce.Offset(0, 0).Left
End With
End Sub
Thanks TigerTiger.
This is close to what i require.
The move is all good - except i would like to keep the relative position of the shape within the cell the same from current cell to cell one row up.
Your code does this except it positions it to the top left of the cell above, not the relative position (eg. if in the middle of the cell, move it to the middle of the cell 1 row up)
I look forward to a solution. thnaks again.
![]()
Sub MoveShape() On Error Resume Next With ActiveWindow.Selection.ShapeRange(1) .Top = .Top - .TopLeftCell.Offset(-1).Height End With End Sub
Entia non sunt multiplicanda sine necessitate
Thanks for the quick response.
Works like a charm.
No longer need to scratch my head any longer (save what little hair i have left).
Thanks again.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks