+ Reply to Thread
Results 1 to 12 of 12

Check boxes macro

  1. #1
    Registered User
    Join Date
    10-04-2012
    Location
    Taunton, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Check boxes macro

    Hi all,

    I have a problem trying to get a macro to work which is attached to a check box.

    the background is that it is for a monthly bonus sheet. Once the site reaches a certain level of recycling then the staff may be entitled to a bonus. The manager will enter the recycling rate in a specific cell at the bottom of the spreadsheet and their is a table on a separate tab which lists the different percentages and how much bonus they get.
    What I have is a tick box next to each individual (there may be reasons why certain staff dont get the bonus that month) and when the tickbox is ticked I want it to look up a percentage figure from cell B22 to work out how much bonus should be paid.

    I have managed to get this to work but what I also would like that when the checkbox is unticked then the bonus figure is deleted.

    Like I said, I have managed to get it to work for once the checkbox is ticked but cant get it to do the deleting bit!
    Last edited by Colhawk; 10-17-2012 at 04:11 AM.

  2. #2
    Registered User
    Join Date
    10-04-2012
    Location
    Taunton, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Check boxes macro

    is that a no one????

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Check boxes macro

    Hi Colhawk

    Please attach a file that represents what you have. The structure of your attachment should be the same structure as your actual data. Any proprietary information should be changed.

    Include in the attachment any code you're currently using (whether it works or not).
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Registered User
    Join Date
    10-04-2012
    Location
    Taunton, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Check boxes macro

    Hi,

    Thanks for the reply jaslake. I have uploaded a copy of the spreadsheet that I use.
    Attached Files Attached Files

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Check boxes macro

    Hi Colhawk

    Try this...let me know of issues
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-04-2012
    Location
    Taunton, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Check boxes macro

    Hi jaslake,

    Thanks for that solution. It works well for the first 3 people on the timesheet but upon the fourth person when I click the check box it comes up with an error saying "Runtime error 1004. The item with the specified name wasn't found"

    I have checked that the checkbox is definitely named Check Box 22 (even cut and paste this in to make sure it was right) but still cannot seem to see why it isnt working, the line it has problems with is coloured in red below.


    Please Login or Register  to view this content.
    Thanks for any help you can give!
    Last edited by Cutter; 10-17-2012 at 06:58 PM. Reason: Added code tags

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Check boxes macro

    Hi Colhawk

    First, please wrap your code in code tags.

    Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    As to your issue...I don't know...there's something that's different. If you'll post the offending file one of us will look at it.

    BUT FIRST, please wrap your code in code tags (Rule #3 explains how to do so).

  8. #8
    Registered User
    Join Date
    10-04-2012
    Location
    Taunton, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Check boxes macro

    Hi jaslake

    Thanks again for helping.

    Sorry here is the code for the fourth check box

    Please Login or Register  to view this content.
    As i said, for some reason, the first 3 work, and the only thing I have changed is the check box name to the correct one and also the range value in the actual IF formula.
    Attached Files Attached Files

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Check boxes macro

    Hi Colhawk

    You don't have a Check Box 22. Right Click on your Check Boxes and Check the Names in the left most Formula Bar Window. The 4th Check Box down is named Check Box 23. Check all the others and revise your code accordingly...it'll work.

  10. #10
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,337

    Re: Check boxes macro

    Assign macro to all your Checkboxes and make sure they are all aligned perfectly in each cell (you might need to increase the rowheight for a perfect fit)
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    10-04-2012
    Location
    Taunton, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Check boxes macro

    Jaslake- I am so sorry i am being an idiot and didnt see that. Thank you so much for all of your help!

  12. #12
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Check boxes macro

    Sometimes I can't see the Forest for the Trees...

    You're welcome...glad I could help. Thanks for the Rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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