+ Reply to Thread
Results 1 to 10 of 10

Deselecting A CheckBox Automatically

  1. #1
    Forum Contributor
    Join Date
    06-24-2009
    Location
    SCOTLAND
    MS-Off Ver
    Excel Version 2308
    Posts
    151

    Deselecting A CheckBox Automatically


    I’m using this code to achieve the following;
    If the box is checked then a message box asks a question.
    If the answer is YES then the current date and users name is entered into cells E3 and F3.
    If the answer is NO then another message box appears with an instruction.
    Click Okay and any contents in cells E3 and F3 are cleared.

    However, I also want to remove the tick from the Check Box if the answer is NO.
    How can this be achieved as well?

    Please Login or Register  to view this content.
    Last edited by heliskier89; 06-17-2011 at 02:23 PM. Reason: Now Solved.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Deselecting A CheckBox Automatically – Help Req’d.

    Please Login or Register  to view this content.
    ??
    Martin

  3. #3
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    Re: Deselecting A CheckBox Automatically – Help Req’d.

    Try this.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Deselecting A CheckBox Automatically – Help Req’d.

    Please Login or Register  to view this content.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  5. #5
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Deselecting A CheckBox Automatically – Help Req’d.

    Oops, a dismal third.

  6. #6
    Forum Contributor
    Join Date
    06-24-2009
    Location
    SCOTLAND
    MS-Off Ver
    Excel Version 2308
    Posts
    151

    Re: Deselecting A CheckBox Automatically – Help Req’d.

    Tried this code but it doesn't clear the checkbox!
    ActiveSheet.CheckBoxes(Application.Caller).Value = 0
    Will this line just look at the checkbox contents but not change them?

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Deselecting A CheckBox Automatically – Help Req’d.

    Hello heliskier89,

    The Forms style Check Boxes use the Excel constant xlOff instead of zero to indicate a False condition. ActiveX Check boxes use zero for false. This will work...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  8. #8
    Forum Contributor
    Join Date
    06-24-2009
    Location
    SCOTLAND
    MS-Off Ver
    Excel Version 2308
    Posts
    151

    Re: Deselecting A CheckBox Automatically – Help Req’d.

    Please Login or Register  to view this content.
    Thanks, that works great. However, it has thrown up another little quirk!
    If cells E3 and F3 have the name and date already inserted and you choose to deselect this by removing the tick from the checkbox, the tick is removed from the checkbox but the contents of E3 and F3 remain.
    Any ideas on how to fix this?

  9. #9
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Deselecting A CheckBox Automatically

    heliskier89,

    Give this a try:
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    06-24-2009
    Location
    SCOTLAND
    MS-Off Ver
    Excel Version 2308
    Posts
    151

    Re: Deselecting A CheckBox Automatically

    Excellent. Thanks very much for the parting of your knowledge on a humble beginner. I'm very grateful and love when I can follow the code so as I don't have to bother you guys as much.

    Many Thanks

+ 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