+ Reply to Thread
Results 1 to 6 of 6

Change color of multiple checkboxes

  1. #1
    Registered User
    Join Date
    09-18-2016
    Location
    sds
    MS-Off Ver
    2013
    Posts
    2

    Change color of multiple checkboxes

    Hi,
    I have this code to change the color of a checkbox when it's ticked:

    Please Login or Register  to view this content.
    However, i have a hundred of checkboxes...is there anyway i could select all the Checkboxes and then apply the code to all of them, instead of creating a hundred subs for each checkbox? i was thinking of using a for loop but didn't know where to place the code.
    Sorry if it has already been asked, i couldn't find anyhing

    Thanks!

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Change color of multiple checkboxes

    If your checkboxes are in order (if not make them ) then use loop through all of them

    Please Login or Register  to view this content.
    (Didn't test)

  3. #3
    Registered User
    Join Date
    09-18-2016
    Location
    sds
    MS-Off Ver
    2013
    Posts
    2

    Re: Change color of multiple checkboxes

    that doesn't work as i wanted because the checkboxes become green only when i click the first one and don't change back to red unless i click the first CheckBox...i need the checkboxes to change color as soon as i click them

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

    Re: Change color of multiple checkboxes

    You could add this to your user form's code module, after changing the indicted lines to match your situation.

    Please Login or Register  to view this content.
    Last edited by mikerickson; 09-18-2016 at 12:28 PM.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,897

    Re: Change color of multiple checkboxes

    crossposted: http://www.mrexcel.com/forum/excel-q...boxes.htmlYour post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Change color of multiple checkboxes

    Maybe this sub:

    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)

Similar Threads

  1. [SOLVED] Toggle between userform checkboxes for multiple pairs of checkboxes
    By L plates in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 04-25-2016, 06:31 AM
  2. Replies: 1
    Last Post: 01-16-2014, 06:13 PM
  3. Change color of multiple Excel files
    By excelactuary in forum Excel General
    Replies: 3
    Last Post: 07-15-2013, 08:49 AM
  4. Replies: 4
    Last Post: 04-28-2013, 12:47 AM
  5. Multiple cell ranges with click color change
    By edge1219 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2011, 04:31 PM
  6. Conditional Cell Color Change For Multiple Cells
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2008, 10:38 PM
  7. Replies: 1
    Last Post: 04-13-2006, 07:30 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