+ Reply to Thread
Results 1 to 3 of 3

Error Checking Multiple Checkboxes in a Userform

  1. #1
    Forum Contributor
    Join Date
    01-04-2013
    Location
    Tampa, Florida
    MS-Off Ver
    Excel 2013
    Posts
    142

    Error Checking Multiple Checkboxes in a Userform

    Hello all,

    I am creating a userform that includes 10 different checkboxes. I want to create a quality check in my vba code that confirms with the user that if none of the checkboxes are marked that they actually want to continue when they click the enter button. I know I can probably use an IF AND statement along the lines of:

    If .Checkbox1.Value = False And .Checkbox2.Value = False And Checkbox3.Value = False And etc. etc. Then...

    Is there a simpler way to write this code that rather than using 10 Ands would be more something along the lines of:

    If Checkbox1.Value through Checkbox10.Value all = False Then...

    My checkboxes are named sequentially Checkbox1 through Checkbox10

    Thanks in advance for any replies.
    Last edited by mo4391; 01-06-2016 at 10:55 AM.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Error Checking Multiple Checkboxes in a Userform

    You could utilize a loop and a boolean variable. Example below:

    Please Login or Register  to view this content.
    If you are happy with my response please click the * in the lower left of my post.

  3. #3
    Forum Contributor
    Join Date
    01-04-2013
    Location
    Tampa, Florida
    MS-Off Ver
    Excel 2013
    Posts
    142

    Re: Error Checking Multiple Checkboxes in a Userform

    Works like a charm. I appreciate the help stnkynuts. (By the way, there's probably a balm or a powder you can get for that )

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Error Checking with Range cell in Userform. Thank you!
    By florayaoyao in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2014, 07:23 PM
  2. Autofilter with multiple checkboxes selections on userform with vba
    By Sravanmonty in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-07-2014, 08:37 PM
  3. [SOLVED] Userform with multiple checkboxes used for autofilter
    By JorisDDS in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-21-2014, 10:41 AM
  4. [SOLVED] Call different macros using multiple control checkboxes in a userform
    By Sideshow1447 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-04-2013, 04:39 PM
  5. Checkboxes in Userform Creates Multiple Data Entries
    By Daneshav in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-01-2013, 09:37 PM
  6. Print Sheets based on checkboxes in UserForm, Checkboxes also control another macro
    By krackaberr in forum Excel Programming / VBA / Macros
    Replies: 34
    Last Post: 03-05-2013, 11:12 AM
  7. Userform with Checkboxes error
    By Toadums in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-13-2008, 05:52 PM

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