Results 1 to 7 of 7

Move Shapes - Loop through all WS not working

Threaded View

  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:

    Sub SimpleLoop()
    '
    ' Simple Loop Macro
    '
    
        Dim ws As Worksheet
        For Each ws In ActiveWorkbook.Worksheets
             
        ws.Range("A1") = ws.Name
             
    Next ws
    End Sub


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


    Sub LoopSheets()
        Dim ws As Worksheet
        For Each ws In ActiveWorkbook.Worksheets
             
             
    'Red
        ActiveSheet.Shapes.Range(Array("Straight Arrow Connector 1")).Select
                    Selection.ShapeRange.IncrementTop -20.5
                    Selection.ShapeRange.IncrementLeft -10.5
    
        
    'Amber
        ActiveSheet.Shapes.Range(Array("Straight Arrow Connector 2")).Select
                    Selection.ShapeRange.IncrementTop -20.5
                    Selection.ShapeRange.IncrementLeft -10.5
       
    Range("A1").Select
    
        Next ws
    End Sub

    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

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