+ Reply to Thread
Results 1 to 5 of 5

Loop to see if checkboxes is True

  1. #1
    Registered User
    Join Date
    10-05-2007
    Posts
    11

    Loop to see if checkboxes is True

    Hey,

    I'm trying to make a macro that loops trough checkboxes and see if they are true. If they are a cell should be updated with a value. This is not on a userform.

    This is my code, but I can't get it to work. The checkboxes are named Disp1 to Disp139. I have made the Controls("Disp" & i) work, but that was when using checkboxes on a userform.

    Any help?

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    This is one way providing the Checkboxes are from the Control Toolbox toolbar & not from the Forms toolbar

    I also do not understand why you are only updating A3 in your posted code & using a variable for the row number

    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Registered User
    Join Date
    10-05-2007
    Posts
    11
    Thanks, this works better, but it dosen't work quite as I want it yet.

    How can I differensiate between checkboxes? I have another 'set' of checkboxes in the same sheet, but those start with 'Act'...Act1, Act2 etc. The ones I want to check starts with 'Disp'.

    The 'j' variable is updated (j=j+1)for each i, so I update 3, 4, 5 etc.

    Thanks for all help

  4. #4
    Registered User
    Join Date
    10-05-2007
    Posts
    11
    Still wondering about how I can differensiate between checkbox-groups, but I found out it was much easier to just have them named CheckBox 1,2 etc.

    Now it works great

  5. #5
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    If you still have them as different name then try

    Please Login or Register  to view this content.

+ 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