PDA

View Full Version : Move WordArts on others Sheets with a checkbox on the active sheet?



Proffskon
09-24-2021, 06:28 AM
Hi!

Im trying to move some WordArt on multiple different Sheets with with a Checkbox the first sheet.
I can move the wordart with a Checkbox on the active sheet with this. I also want this to move back and forward.



Sub CheckBox34_Klicka()
If ActiveSheet.Shapes(Application.Caller).ControlFormat.Value = 1 Then
ActiveSheet.Shapes.Range(Array("Rektangel 2")).Select
Selection.ShapeRange.IncrementLeft 2000
Else
ActiveSheet.Shapes.Range(Array("Rektangel 2")).Select
Selection.ShapeRange.IncrementLeft -2000
End If
End Sub

I have tried some alternativs lika changing activesheet to worksheet but its fails..

Any suggestion how to move WordArts on others Sheets with a checkbox on the active sheet?

p45cal
09-25-2021, 06:25 AM
If ActiveSheet.Shapes(Application.Caller).ControlFormat.Value = 1 Then
Sheets("Sheet8").Shapes("Rectangle 1").IncrementLeft 20
Else
Sheets("Sheet8").Shapes("Rectangle 1").IncrementLeft -20
End If

Proffskon
10-09-2021, 07:01 AM
Thanks!
It works perfectly!

Proffskon
10-10-2021, 04:07 AM
Got new problem when implemented it correctly in the sheet, got the Debug 9, when everything should be fine.. Its placed in the middle of the sheet so borders should not be the problem. Any more suggestions?

2904429045



Sub CheckBox2_Click()
If ActiveSheet.Shapes(Application.Caller).ControlFormat.Value = 1 Then
Sheets("Sheet5").Shapes("Rectangle 1").IncrementLeft 20
Else
Sheets("Sheet5").Shapes("Rectangle 1").IncrementLeft -20
End If
End Sub

p45cal
10-10-2021, 04:44 AM
It means either :
1. You've got the name of the shape wrong; you've either renamed it or and/or deleted it.
and/or:
2. You've changed the name of the sheet or deleted the sheet.
Check the shape's name by selecting it then look in the Name area of the application (where you'd normally see the address of the selected cell) to discover the new shape's name, then use that in the code.
Check the sheet's name too.
Change the code to match.
The Subscripts are the bits in parentheses in the code.

29046