Consulting

Results 1 to 4 of 4

Thread: Sleeper: CheckBoxes

  1. #1

    Sleeper: CheckBoxes

    Ive been having a heck of a time trying to get a simple check box code to work. Essentially I'm trying to use a checkbox to create another sheet and move certain cell information to specific cells in the new sheet. I'm starting small just to get the add sheet code to work and then build on that but nothing is working. Here's what I've been trying:

    Sub CheckBoxFromHell()
    If Worksheets("Schedule").CheckBoxes("CheckBox1").Value = True Then
        Sheets.Add.Name = "Transformer"
    End If
    End Sub
    So far, I can't get the add sheet command to work on this particular spreadsheet. I copied a table from another sheet I didn't create to a new one in the event that there were settings on the original sheet causing errors (protected portions?).
    Last edited by Aussiebear; 11-14-2023 at 11:17 PM. Reason: Added code tags to supplied code

  2. #2
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,244
    Location
    Welcome to the forum,

    If it is an ActiveX checkbox then you can try the below:
    Sub CheckBoxFromHell()    
        If Worksheets("Schedule").CheckBox1.Value = True Then
            Sheets.Add.Name = "Transformer"
        End If
    End Sub
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2405, Build 17628.20102

  3. #3
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,183
    Location
    Sadly it seems "TheWireNut" has succumbed to his injuries..... Make sure you keep yer eyes on dem pesky checkboxes from here on in.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,746
    Location
    Quote Originally Posted by Aussiebear View Post
    Sadly it seems "TheWireNut" has succumbed to his injuries..... Make sure you keep yer eyes on dem pesky checkboxes from here on in.



    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Posting Permissions

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