crazyeyeschase
Board Regular
- Joined
- May 6, 2014
- Messages
- 104
- Office Version
- 365
- Platform
- Windows
I have a macro that resizes all of the shapes within a sheet excluding one. When I run the macro it works fine however it pulls an error "VBA Run-time error -214724809 (80070057)"
This is the code
When i run the debug it comes back with "shape.select" highlighted.
The error also says
Method 'select' of object 'shape' failed
If i remove this line then the macro doesnt work correctley so im not sure what to do here.
This is the code
Code:
Sub Resize()
For Each shape In Sheets("Sheet1").Shapes
If shape.Name = "RightArrow" Then
Else:
[COLOR=#ff0000]shape.Select[/COLOR]
Selection.ShapeRange.ScaleWidth 1.1, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 1.1, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.IncrementLeft 10
Selection.ShapeRange.IncrementTop 3
End If
Next
End Sub
When i run the debug it comes back with "shape.select" highlighted.
The error also says
Method 'select' of object 'shape' failed
If i remove this line then the macro doesnt work correctley so im not sure what to do here.