Consulting

Results 1 to 5 of 5

Thread: Move WordArts on others Sheets with a checkbox on the active sheet?

  1. #1

    Move WordArts on others Sheets with a checkbox on the active sheet?

    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?
    Last edited by Aussiebear; 10-01-2021 at 12:36 PM. Reason: Added code tags to supplied code

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,871
    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
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    Thanks!
    It works perfectly!

  4. #4
    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?

    Error 9.jpgDebug.jpg

    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

  5. #5
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,871
    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.

    2021-10-10_124314.jpg
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •