+ Reply to Thread
Results 1 to 7 of 7

Userform loop thru checkboxes and if true......

  1. #1
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Userform loop thru checkboxes and if true......

    Kind of strugling with a userform in which I have made 3 checkboxes.

    The idea is that the user get the userform and can select 1 to 3 of the options.
    Then a button 'Go' will need to set of some vba code which loops thru the 3 checkboxes to see what was chosen.

    When true its needs to do something and when false just go on to the next box.

  2. #2
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: Userform loop thru checkboxes and if true......

    I did find this code :
    Please Login or Register  to view this content.
    But that is not doing more then giving the names of the checkboxes I made.

    Obviously like this it is no use to me.

  3. #3
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: Userform loop thru checkboxes and if true......

    Another code i tried:
    Please Login or Register  to view this content.
    But this gives me "object variable or with block variable not set" error

    This code however describes best what i want I guess.

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Userform loop thru checkboxes and if true......

    In post #2, replace the message box with the code to do what you want.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: Userform loop thru checkboxes and if true......

    yeah but there are 3 checkboxes, so it should look 3 times and depending on the true or false of the checkbox do "something"

  6. #6
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Userform loop thru checkboxes and if true......

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: Userform loop thru checkboxes and if true......

    Superb Kenneth!

    Thanks a lot, works like a charm.

+ 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. [SOLVED] How to loop through CheckBoxes on UserForm
    By tnuis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2014, 03:39 AM
  2. [SOLVED] Group of checkboxes, indicate when all true and indicate when not all true
    By Rachael Whyment in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-14-2013, 08:26 AM
  3. [SOLVED] Group of checkboxes, indicate when all true and indicate when not all true
    By Rachael Whyment in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2013, 06:43 AM
  4. 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
  5. Only allow up to 4 checkboxes to be True in Userform
    By Bluewhistler in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-26-2010, 06:24 AM
  6. Loop to see if checkboxes is True
    By nevrborn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-29-2007, 04:37 PM
  7. Loop through Checkboxes in a UserForm
    By PeterWilliams in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2007, 09:22 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