+ Reply to Thread
Results 1 to 12 of 12

remove checkbox ticks from last use upon opening user form

  1. #1
    Forum Contributor
    Join Date
    06-01-2009
    Location
    Cincinatti,Ohio
    MS-Off Ver
    Excel 2003
    Posts
    122

    remove checkbox ticks from last use upon opening user form

    first of all, I apologize for asking a question that I KNOW has been answered before but, I am having trouble applying the answers I have found to my situation. I am simply trying to write a macro or code that will set all the check box values to "False" each time I initiate the User form. So that the user form does not "carry over" check box values from the last time the User form was used.
    Thanks in advance for any help.any help at all..........

    --edit---This did the trick!
    However I had to make sure I cleared the value from the cell that each control is associated with.(the controlsource in the user form properties.)

    Thanks for all your help!

    Please Login or Register  to view this content.
    Last edited by TheNewGuy; 06-12-2009 at 01:26 PM.

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

    Re: remove checkbox ticks from last use upon opening user form

    Isn't it just
    Please Login or Register  to view this content.
    with checkbox = to whatever you named your checkbox?
    I believe you put that in the initialize form event.
    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

  3. #3
    Forum Contributor
    Join Date
    06-01-2009
    Location
    Cincinatti,Ohio
    MS-Off Ver
    Excel 2003
    Posts
    122

    Re: remove checkbox ticks from last use upon opening user form

    Yea! That is what I thought, but the problem is that when the check box is un-ticked ,The sub checkbox1_click automatically runs. So it works but it only removes the tick from one check box each time you open the form. So if you had 5 check box's ticked you would need to open and close it 5 times to remove all the ticks..... I tried deleting the offending subprograms but it made no difference. This is what I have tried so far


    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    There has to be something simple that I am doing wrong...But I don't know what it is.
    Thanks for your help.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: remove checkbox ticks from last use upon opening user form

    The default should be false so initialising should clear them

    This function will clear all controls
    Please Login or Register  to view this content.
    On the UserForm
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Contributor
    Join Date
    06-01-2009
    Location
    Cincinatti,Ohio
    MS-Off Ver
    Excel 2003
    Posts
    122

    Re: remove checkbox ticks from last use upon opening user form

    Thanks for your help royUK. I really appreciate it. But, I am still unable to get your code to work. Where should I paste your function code? and do I need to make a new command button that is set to clear the form? I would like the form to initialize with all check box values=false. I can attach my work book if you think it will help. Thanks again for all your help.

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

    Re: remove checkbox ticks from last use upon opening user form

    Is the default set to "false" on the properties of each check box? (like royUK mentioned?)

  7. #7
    Forum Contributor
    Join Date
    06-01-2009
    Location
    Cincinatti,Ohio
    MS-Off Ver
    Excel 2003
    Posts
    122

    Re: remove checkbox ticks from last use upon opening user form

    Do you mean the value? If so yes it is set to "False" for each of the chackbox's. Thanks again for the help! Much appreciated!

  8. #8
    Forum Contributor
    Join Date
    06-01-2009
    Location
    Cincinatti,Ohio
    MS-Off Ver
    Excel 2003
    Posts
    122

    Re: remove checkbox ticks from last use upon opening user form

    OK now I am getting confused! I thought I had it working, in fact I know I had it clearing the values upon initialization, but now it is working as before. It only clears one checkbox value each time you initiate the form. Can some one please help me figure out why this is happening. Does it matter where I save the sub program that I posted in my first post? I would appreciate any advice. Thanks for your time.

    -edit- I have noticed if I run the user form from the vb editor and press F8 for each line of code it will work as it should but if I run the user form from the workbook it does not.
    Last edited by TheNewGuy; 06-03-2009 at 07:52 AM.

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: remove checkbox ticks from last use upon opening user form

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  10. #10
    Forum Contributor
    Join Date
    06-01-2009
    Location
    Cincinatti,Ohio
    MS-Off Ver
    Excel 2003
    Posts
    122

    Re: remove checkbox ticks from last use upon opening user form

    Ok, Thank you. That is no problem.
    However in the process of making a dummy file for you I deleted all sheets that were before or after this sheet containing the userform,.. and now the userform gets cleared correctly....? SO, there must be some conflicting code somewhere. But I don't know were it is. So I have attached a copy of both the example workbook, and the complete workbook. Hopefully you can figure out what I have done to this thing! Again,Thank you very much for all your help!
    -note- the user form I am working on is the one labeled "round specimen processes" it is activated by clicking the graphic at the top left of page "processes and router set up".
    Attached Files Attached Files
    Last edited by TheNewGuy; 06-03-2009 at 08:38 AM.

  11. #11
    Registered User
    Join Date
    03-20-2013
    Location
    Findlay, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: remove checkbox ticks from last use upon opening user form

    Deleted post because I broke Forum rule #2.
    Last edited by tabbott0829; 03-21-2013 at 11:09 AM. Reason: Need to start a new thread

  12. #12
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: remove checkbox ticks from last use upon opening user form

    Hi, tabbott0829,

    Welcome to the Forum.

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

    And please: use code tags around code.

    Posting code in [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

+ 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