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.
Bookmarks