Moving Shapes

Noz2k

Well-known Member
Joined
Mar 15, 2011
Messages
693
On a websheet form I have a diagram, and then next to it some donut shapes that the user can move to indicate a specific position on the diagram.

However at the top of a form is a combobox which changes a lot of the values in the form. What I want to be able to do is move the shapes back to a default position whenever the value in the combobox is changed.

I know how to specify when the combobox is changed, and I know how to move the shapes based on their current position.

How do I move the shapes either to a specified position on the worksheet, or relative to a static location on the worksheet?

The only code I have so far for the shapes is

Code:
Sub FormatShapes()
'
' FormatShapes Macro
'
'
    ActiveSheet.Shapes.Range(Array("Donut 67")).Select
    Selection.ShapeRange.IncrementLeft -95.75
    Selection.ShapeRange.IncrementTop -76.5
End Sub

If possible I would also like to make it so whilst the shapes can be moved they cannot be deleted or resized.

Thanks in advance
 
Last edited:

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Ok, have worked out how to move the shapes, now just need to work out how to resize them back to default (or lock resizing), and lock deleting.

Also for the arrow shapes, to make sure they are horizontal and pointing in the correct direction
 
Upvote 0
Okay so have managed to get the shapes to all move to a default position on the sheet and size as desired.

Code:
 With ActiveSheet.Shapes("Donut4")
    .Left = 111
    .Top = 1836
    .Height = 18
    .Width = 20
    End With
    
    With ActiveSheet.Shapes("Arrow1")
    .Left = 410
    .Top = 1835
    .Height = 0
    .Width = 80
    End With
'etc

However I would also like prevent the objects from being deleted. I can't just lock them as that prevents them being moved. If possible I would prefer to do it without protecting the sheet.

As a workaround I think I could delete the objects and then add new objects with the same names.

If possible I would also like to make the arrows point in the correct direction (from right to left), again I could do this by deleting and creating new, but would be interested to learn another way.
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,119
Members
452,381
Latest member
Nova88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top