+ Reply to Thread
Results 1 to 7 of 7

Move Shapes - Loop through all WS not working

  1. #1
    Registered User
    Join Date
    10-30-2009
    Location
    UK
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    60

    Move Shapes - Loop through all WS not working

    Hi folks

    I'm having trouble creating a loop that will move named shapes on a worksheet and then move to the next worksheet.

    I've tried a basic loop as below and this works fine:

    Please Login or Register  to view this content.


    But when I try my actual code, it's not looping to the next WS


    Please Login or Register  to view this content.

    On each sheet there is definitely shapes called Straight Arrow Connector 1 and 2, but when I run the code it doesn't move to the next worksheet, it just moves the shapes on the active worksheets a few times.

    I've got a workbook with around 200 worksheets with markers (shapes) on each which I'd like to move without having to recreate the entire file if this is possible.
    Last edited by Janc; 07-19-2015 at 08:46 AM. Reason: Solved

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Move Shapes - Loop through all WS not working

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-30-2009
    Location
    UK
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    60

    Re: Move Shapes - Loop through all WS not working

    Thanks Bakerman, I've just tried that but it still isn't looping correctly.

    It runs through the code once, moves the shapes on the active ws and then attempts to loop again on the same sheet but this time breaking with a "runtime error 438 - object doesn't support this property or method".

    I've attached a very simple sample file if that helps at all to see what's happening and where it's going wrong?
    Attached Files Attached Files

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Move Shapes - Loop through all WS not working

    Try This:-
    Please Login or Register  to view this content.

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Move Shapes - Loop through all WS not working

    Or this one.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-30-2009
    Location
    UK
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    60

    Re: Move Shapes - Loop through all WS not working

    Thanks Mick, that works perfectly. As does the second code posted by Bakerman.

    Problem solved, thank you both very much

  7. #7
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Move Shapes - Loop through all WS not working

    You're welcome

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Why do my shapes move when I print the sheet?
    By jambog in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 07-01-2015, 07:49 PM
  2. [SOLVED] loop through shapes ?
    By Lukael in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2014, 08:11 AM
  3. Different Display Scales move shapes
    By Steveapa in forum Excel General
    Replies: 3
    Last Post: 02-14-2014, 11:31 AM
  4. [SOLVED] Move Two Shapes In The Same Loop
    By primed in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-22-2014, 08:03 AM
  5. how to move excel shapes
    By jonelamora in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-24-2012, 10:45 PM
  6. Move Shapes to Grid in Excel
    By Environment in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-17-2011, 08:40 AM
  7. How To Move Shapes From Another Shapes? (floating shapes)
    By MarcLev in forum Word Programming / VBA / Macros
    Replies: 2
    Last Post: 10-04-2009, 04:04 PM

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