+ Reply to Thread
Results 1 to 20 of 20

Uncheck Check Box 48 when Check Box 46 selected

  1. #1
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Uncheck Check Box 48 when Check Box 46 selected

    I have two check boxes the user must pick from - they represent locations - you can only be in location A or K. I'm not an expert so work around my limitations dealing with problems piecemeal. Included is some code I figure out by recording a macro assigned to one of the check boxes. Have something similar for the other check box. When a location check box is picked it does a few things like input a letter into cell10 and unhide or hide tabs.

    So my task is to add to this code below that will uncheck box 46 when check box 48 checked and also the reverse (uncheck box 48 when check box 46 is checked.)

    Thanks for any direction.

    -j

    HTML Code: 

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

    Re: Uncheck Check Box 48 when Check Box 46 selected

    Hello JET2011,

    We need a bit more information.

    Are your CheckBoxes, Forms Controls or ActiveX Controls?

    Are they on a Worksheet, or Userform?

    Regards.
    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] .

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

    Re: Uncheck Check Box 48 when Check Box 46 selected

    Post duplicated, and deleted.
    Last edited by Winon; 02-23-2016 at 02:58 PM.

  4. #4
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Uncheck Check Box 48 when Check Box 46 selected

    This is a form control check box (when it right click on it the cell name in the above tool bar is "Check Box 3348" and it is on a worksheet.

    (lost the connection when I went to post the thread)

    Thanks for reviewing.

    jt

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

    Re: Uncheck Check Box 48 when Check Box 46 selected

    why not use Option Buttons?
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  6. #6
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Uncheck Check Box 48 when Check Box 46 selected

    I have worked weeks on this project and has many worksheets that drive of this approach. This is the absolute last step in the project so would like to stick with this idea. If we get a fix here its ready to be released -

    Thanks

  7. #7
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Uncheck Check Box 48 when Check Box 46 selected

    Minor note - There are only two check boxes on this entire project.

  8. #8
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Uncheck Check Box 48 when Check Box 46 selected

    Option buttons would be the way to go, but this should work - just alter button names to suit
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Uncheck Check Box 48 when Check Box 46 selected

    Thanks Stephen-

    I inserted your code above at the beginning of the existing code I had - hopefully that was correct. The checkboxes (as the names appear when selected are called Check Box 3448 and Check Box 3646 - I'm guessing the correct format in the code would be checkbox3448 or checkbox3646. I edited your code to reflect the worksheet tab is named summary - hopefully that was correct. When I use the check boxes the functionality I had still works but the unchecking feature was not working - which is the only feature remaining on the project. Did I make all the edits needed?


    HTML Code: 
    Last edited by JET2011; 02-24-2016 at 05:57 PM.

  10. #10
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Uncheck Check Box 48 when Check Box 46 selected

    Don't forget to change the check box name in the code itself - change 1 to 3448 and 2 to 3646.

  11. #11
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Uncheck Check Box 48 when Check Box 46 selected

    Thanks again Stephen-

    I didn't forget just don't know exactly what I'm doing when it comes to the code. I made this change but the unchecking feature still not functioning. The are no errors messages either.

    HTML Code: 

  12. #12
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Uncheck Check Box 48 when Check Box 46 selected

    Can you post a workbook - it will be quicker?

  13. #13
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Uncheck Check Box 48 when Check Box 46 selected

    Please see attached file - thanks.
    Attached Files Attached Files

  14. #14
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Uncheck Check Box 48 when Check Box 46 selected

    Should work now - I have stripped out most of your example file. A couple of issues - you had macros for the boxes in two separate places and in one of them the names were incorrect. Also, I corrected the sheet syntax.
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Uncheck Check Box 48 when Check Box 46 selected

    Thanks so much and explaining some of the fixes. I went back to my original file - you have not seen the complete edition and made the edits to add Sheets("Summary").

    I could not get the unchecking featured to work like in your file solution. Your file does not have all the functionally especially typing the letter A or letter K in cell C10 based on which location is selected. Also sheets are not hidden or not based on location selected (I recreated sheets KD and KD to test this.) I'm trying to get this to work but at the same time learning - I've studied what you have done pretty closely. This has been helpful but still need to pull it all together.

    --j

  16. #16
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Uncheck Check Box 48 when Check Box 46 selected

    File revised - corrected with Sheet("Summary") but unchecking not working yet.

    See attached.

    Regards,
    Attached Files Attached Files

  17. #17
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Uncheck Check Box 48 when Check Box 46 selected

    You've still got two copies of the code, in modules 2 and 4. First, delete module 4. But the problem is that for some reason the buttons are not assigned to the correct macro. If you right-click the 3448 button, Assign macro, select CheckBox3448_Click and press OK. Then do the same for the 3646 button, making sure you select the CheckBox3646_Click macro.

  18. #18
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Uncheck Check Box 48 when Check Box 46 selected

    I deleted the two module 4s and assigned the checkbox macros. It works! However - I can't get my other functions back working -- the code after the routine for the checkboxes does nothing. For instance the first check box should type "A" in cell c10 then a few other things. Checking the other box should type "K" in C10, etc.

  19. #19
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Uncheck Check Box 48 when Check Box 46 selected

    So perhaps this is what you need. Put it all in one module and delete the others. Make sure the check boxes are still assigned to the correct macro
    Please Login or Register  to view this content.

  20. #20
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Uncheck Check Box 48 when Check Box 46 selected

    IT WORKS!!! Thanks so much for sticking with me - this is a complex solution for a limited user. I learned a lot and got my project done. I'll be going to London to personally thank you.

    Cheers!

    J

+ 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. Replies: 2
    Last Post: 03-25-2015, 12:07 PM
  2. VBA help with check and uncheck
    By akajj13 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-23-2013, 01:02 AM
  3. Uncheck a Check Box using VBA
    By ashmott in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-01-2011, 10:29 PM
  4. Uncheck Check Box + check a option button using Command Button
    By Carlsbergen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2009, 03:09 AM
  5. Check and uncheck a checkbox
    By NoProgram in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-25-2006, 05:50 PM
  6. Uncheck check boxes
    By Brisbane Rob in forum Excel General
    Replies: 3
    Last Post: 02-15-2006, 03:08 PM
  7. 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