+ Reply to Thread
Results 1 to 23 of 23

check and uncheck certain checkboxes with a button

  1. #1
    Registered User
    Join Date
    03-11-2015
    Location
    slovenia
    MS-Off Ver
    MS Office for Mac 2016
    Posts
    20

    check and uncheck certain checkboxes with a button

    I am creating a document where I want to check or uncheck all checkboxes in just one row with master button.
    Can somebody help me please :/
    Last edited by 2mi3; 03-11-2015 at 08:29 PM.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: check and uncheck certain checkboxes with a button

    If you can tell us which boxes, and provide a file to work with, yes we probably can.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Registered User
    Join Date
    03-11-2015
    Location
    slovenia
    MS-Off Ver
    MS Office for Mac 2016
    Posts
    20

    Re: check and uncheck certain checkboxes with a button

    Thanks for a fast response. Can you please tell me how to add a file?

  4. #4
    Registered User
    Join Date
    03-11-2015
    Location
    slovenia
    MS-Off Ver
    MS Office for Mac 2016
    Posts
    20

    Re: check and uncheck certain checkboxes with a button

    kartica osebe.jpg

    I want that long buttons ftom C8 to C20 check and uncheck entire row

  5. #5
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: check and uncheck certain checkboxes with a button

    When doing a reply, there is a "Go Advanced" button below on the right. Click on that, and then choose the paperclip picture next to the smiley face in the menu above.

  6. #6
    Registered User
    Join Date
    03-11-2015
    Location
    slovenia
    MS-Off Ver
    MS Office for Mac 2016
    Posts
    20

    Red face Re: check and uncheck certain checkboxes with a button

    Thanks for this
    Attached Images Attached Images

  7. #7
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: check and uncheck certain checkboxes with a button

    Hmmm I'm not getting your attachment (excel file I hope?)
    Your picture from before does not get displayed either, so I still don't know exactly what you need.

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: check and uncheck certain checkboxes with a button

    Hello 2mi3,

    Perharps something like the attached sample Workbook, which takes care of either Forms Control Checkboxes, or Active X Control Checkboxes.

    Hope that helps.

    It is always better to attach a sample Workbook when needed, to illustrate your exact requirement, to enable us to solve your issue to your sastisfaction.

    Regards.
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  9. #9
    Registered User
    Join Date
    03-11-2015
    Location
    slovenia
    MS-Off Ver
    MS Office for Mac 2016
    Posts
    20

    Re: check and uncheck certain checkboxes with a button

    Sorry guys I am such a clumsy.. Here is the excel file. Thanks again
    Attached Files Attached Files

  10. #10
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: check and uncheck certain checkboxes with a button

    Try this one... It relies on the fact that all your checkboxes are already linked to a cell which was great, and all the boxes in a row are linked to the same cell row. For example all your row 8 boxes are linked to a cell in row 31, so using the row number of the linked cell is how the macros know which boxes to check. Please remember that in future if you add boxes.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    03-11-2015
    Location
    slovenia
    MS-Off Ver
    MS Office for Mac 2016
    Posts
    20

    Re: check and uncheck certain checkboxes with a button

    Arkadi that is great. Macro is working beautifully
    I am grateful for your time and help. However, I have one more problem, How can I mark a column as Sunday or holiday in first sheet (master sheet) and let all the following sheets follow that. Saturday, Sunday and holiday should be also recognized as different by the SUM or COUNTIF formula? I uploaded a file also..
    Thanks again
    Attached Files Attached Files

  12. #12
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: check and uncheck certain checkboxes with a button

    2mi3,

    I am sorry I don't understand. Where are you marking something as sunday or holiday in master sheet? and where on other sheets is this supposed to be followed? I also don't know where your formula is, or what you mean by recognized as different... different from what? Once I understand, I'll be more than happy to try and help.

  13. #13
    Registered User
    Join Date
    03-11-2015
    Location
    slovenia
    MS-Off Ver
    MS Office for Mac 2016
    Posts
    20

    Re: check and uncheck certain checkboxes with a button

    Hello Arkadi, the document is monthly calendar its purpose is to calculate presence and absence to community work and also lunch subvention etc. Since this document will be used by a person who is not very familiar with excel I would like the document to be as automatized as possible. Therefore I created a master sheet - the first sheet of the document, this sheet will be write protected, except saturday, sunday and holiday input (wich I dont know how it will look yet).
    Second sheet is sheet of the unit with ten volunteers. There are seven units. This sheet will be fully write protected.
    All the other sheets are personal volunteer card where you determinate eather person was absent or where and when it was present. This sheet will be only partial protected - (checkboxes are of course unprotected.)
    I am sorry for my poor english and thanks for helping me out again
    ps
    Since this will be universal document without monday, tuesday and so on already marked I would like to be able to point first sunday with macro button and all the other sundays in the month will be determined by this first one.. folowed by all the other sheets in the document.
    Attached Files Attached Files

  14. #14
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: check and uncheck certain checkboxes with a button

    OK so sheet abc123, you need a button, it will ask you what first Sunday is, and determine other sundays... but how will it be marked? highlight column for that date, or an x at top... need to know what you want there. Then on ALL other sheets it will mark sundays also.. is that correct?

    I see you have columns with dates 1, 8, 15, 22, 29 highlighted right now... is that the way to show sundays?.

  15. #15
    Registered User
    Join Date
    03-11-2015
    Location
    slovenia
    MS-Off Ver
    MS Office for Mac 2016
    Posts
    20

    Re: check and uncheck certain checkboxes with a button

    Yes, columns 1, 8, 15, 22 and 29 are more or less how Sundays should look. Saturdays are not yet marked neither any holiday. It would be also appropriate to be able to block 31st, 30th and 29th in a month. I donīt have a solution for that either.
    Thanks for taking your time to help me out.
    Last edited by 2mi3; 03-12-2015 at 02:51 PM.

  16. #16
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: check and uncheck certain checkboxes with a button

    No problem... I'm pretty busy today, but will try to look at this more tonight at home, or tomorrow morning if I have some time.

  17. #17
    Registered User
    Join Date
    03-11-2015
    Location
    slovenia
    MS-Off Ver
    MS Office for Mac 2016
    Posts
    20

    Re: check and uncheck certain checkboxes with a button

    Thanks. I appreciate.

  18. #18
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: check and uncheck certain checkboxes with a button

    Hi 2mi3,

    I have most of the Sunday code figured out, I am not certain why the sheets that have a numeric name (1,2,3) think the last row is 30 when it is less... I don't know if your real workbook will have the same problem, but if it does we can make some small adjustments later. For now, please test the code below to see if you are happy with what it does... I would copy all this code and put it in a new module. Then test it, but of course always keep a backup of original before running macros in test mode.

    Please Login or Register  to view this content.
    Last edited by Arkadi; 03-13-2015 at 01:26 PM.

  19. #19
    Registered User
    Join Date
    03-11-2015
    Location
    slovenia
    MS-Off Ver
    MS Office for Mac 2016
    Posts
    20

    Re: check and uncheck certain checkboxes with a button

    Hi Arkadi,
    I copied the code into new module as you suggested and then tried to run it through macros button on the ribbon. First new window appeared which asked for a month setup (I input 3) after second window appeared asking for a year to set up and I entered 2015. This is what I get:

    Run-time error '9':
    Subscript out of range

    Set ws = Worksheets("1") this part was marked yellow as I click debug

  20. #20
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: check and uncheck certain checkboxes with a button

    Doh sorry did that for testing and forgot to change it back...I will edit my post from before, so just copy it again. SORRY

    Code fixed now.

  21. #21
    Registered User
    Join Date
    03-11-2015
    Location
    slovenia
    MS-Off Ver
    MS Office for Mac 2016
    Posts
    20

    Re: check and uncheck certain checkboxes with a button

    it works. Super, thanks man
    Can this orange color and shape be adjusted on easy way? And can the saturday be atached and determined by the same input?
    Last edited by 2mi3; 03-13-2015 at 02:17 PM.

  22. #22
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: check and uncheck certain checkboxes with a button

    Shape? I don't know what you mean by shape, but the color can change easily... the line:
    Please Login or Register  to view this content.
    sets the color, 40 is the orange color you had in your example. If you google "vba colorindex" it will be easy to find information on what number = what color.
    Saturday can be added.
    In my code this line:
    Please Login or Register  to view this content.
    uses the function "datesfordayofweek" to get the dates for sunday which in VBA is default first day of the week. The mnt is the month you entered, yr is the year, and the 1 is sunday. So if you add a second variable, you could also collect dates for saturdays. after thedates=... you could add the same line a second time, maybe call it thedates2?:
    Please Login or Register  to view this content.
    see I changed the 1 to a 7? that will do saturdays. Then after this line:
    Please Login or Register  to view this content.
    add this line:
    Please Login or Register  to view this content.
    to do saturdays also.

  23. #23
    Registered User
    Join Date
    03-11-2015
    Location
    slovenia
    MS-Off Ver
    MS Office for Mac 2016
    Posts
    20

    Re: check and uncheck certain checkboxes with a button

    Arkadi, thanks a lot you're the best

+ 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] multiple checkboxes macro check/uncheck
    By SHELTONUNDERDOG in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-07-2012, 01:36 PM
  2. How to check and uncheck a column of checkboxes with 1 checkbox?
    By kteo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-10-2012, 08:42 PM
  3. Forms Check/Uncheck CheckBoxes
    By Kaziglu Bey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-26-2008, 03:04 PM
  4. Check/Uncheck all checkboxes
    By JChandler22 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-23-2007, 03:03 PM
  5. [SOLVED] How do I check/uncheck ten or odd Checkboxes by click on one check
    By Ken Vo in forum Excel General
    Replies: 5
    Last Post: 01-04-2006, 07:15 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