+ Reply to Thread
Results 1 to 5 of 5

VB checkbox checked?

  1. #1
    Registered User
    Join Date
    04-10-2009
    Location
    pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    VB checkbox checked?

    I have a series of checkboxes, each one is linked to its own cell, that all need to be checked before my macro can move on.

    I need a VB script that will look at a range of cells and if each one is marked "True" to execute the next part of the macro. Or look at my series of checkboxes and if they are all checked to execute the next part of the macro.

    I could use a series of if-and statements to look at each cell but this could end up being a very long string of statements.

    Is there a way to check if a range of cells or checkboxes are all true/checked?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: VB checkbox checked?

    Hello prowsdower,

    Welcome to the Forum!

    Here is macro to check if the check boxes on the ActiveSheet are all checked. This assumes you are using Forms Checkboxes.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    04-10-2009
    Location
    pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: VB checkbox checked?

    thanks leith, that code looks good but i think it needs modified a little.

    I have groups of checkboxes, when you've checked all the checkboxes in one group the user is moved down to the next group of checkboxes. So i can't check the global checkbox status, I need to check specific groups of checkboxes. such as "checkbox5:checkbox10", and at the next group "checkbox11:checkbox20"

    I was going to try replaceing "activesheet.checkboxes" here:
    Please Login or Register  to view this content.
    with a range of checkboxes but i dont know the syntax. I'm pretty new to VB.

    Thanks for helping!

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: VB checkbox checked?

    Hello prowsdower,

    Can you post you post your workbook so I can see what type of Check Boxes you are using and how they are arranged?

  5. #5
    Registered User
    Join Date
    04-10-2009
    Location
    pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: VB checkbox checked?

    sorry leith,
    i actually can't post it cause of company property and all. I just follow the rules.

    here is my code so far though:
    Please Login or Register  to view this content.
    this is working out it seems. Now i just need it figure out how to make it also look at cells A1710:A1714. I tried adding another "For Each..." part under the current one but that didn't work out. My "cboxvalue" value came back as "0". I'll just keep tinkering.

    thanks though for your help, I used the code you gave me to come up with this one. Appreciate the help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1