+ Reply to Thread
Results 1 to 6 of 6

VBA to move shape from current cell position to cell 1 row up

  1. #1
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    VBA to move shape from current cell position to cell 1 row up

    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.

  2. #2
    Valued Forum Contributor
    Join Date
    11-11-2008
    Location
    Euro
    MS-Off Ver
    2007, 2010
    Posts
    470
    Quote Originally Posted by wotadude View Post
    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
    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(-10).Top
          
    .Left Poce.Offset(00).Left
        End With
    End Sub 

  3. #3
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255
    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.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255
    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.

  6. #6
    Valued Forum Contributor
    Join Date
    11-11-2008
    Location
    Euro
    MS-Off Ver
    2007, 2010
    Posts
    470
    Quote Originally Posted by shg View Post
    Please Login or Register  to view this content.
    That is nice code!
    thanks you a lot
    I have been busy two day later

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1