+ Reply to Thread
Results 1 to 4 of 4

Checkbox in Userform

  1. #1
    Forum Contributor NewYears1978's Avatar
    Join Date
    03-15-2010
    Location
    Forney, TX
    MS-Off Ver
    Excel 2016
    Posts
    962

    Checkbox in Userform

    I have a checkbox in a userform (simply a do not show again) but it doesn't seem the value is being stored.

    I created a userform (Userform1) added a checkbox (Checkbox1)

    I put this in code to test
    Please Login or Register  to view this content.
    The msgbox do work when I check and uncheck it.

    However that value doesn't seem to save so if I check it and reopen the box it's always unchecked therefore if I use an If Userform1.Checkbox1.value = True statement it doesn't work because after I check it and close the form next time I open it it is not checked again.

    My test code
    Please Login or Register  to view this content.
    Works but everytime I run test macro the CheckBox value is reset to false (even if I click the box it doesn't change value to true)
    I must be missing a step?
    Last edited by NewYears1978; 08-25-2020 at 04:13 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,802

    Re: Checkbox in Userform

    Please show all of the code in the UserForm code module.

    How do you close the form when it is being closed?

    If you use
    Please Login or Register  to view this content.
    then the state of the UserForm is lost, and it is reinitialized the next time it is shown

    If you use
    Please Login or Register  to view this content.
    the state of the UserForm is kept active and will still be in place the next time it is shown.

  3. #3
    Forum Contributor NewYears1978's Avatar
    Join Date
    03-15-2010
    Location
    Forney, TX
    MS-Off Ver
    Excel 2016
    Posts
    962

    Re: Checkbox in Userform

    That was it, I feel dumb thank you!

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,802

    Re: Checkbox in Userform

    You are welcome. It is very common for people not to understand the difference, not dumb at all. Thanks for the rep!

    If your question has been answered please mark your thread as "Solved" so that members will know by looking at the thread title that your problem is solved. Go to the menu immediately above your first post to the thread and click on Thread Tools. From the dropdown menu select "Mark this thread as solved..."

+ 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] two Checkbox with userform
    By hkbhansali in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2018, 07:59 AM
  2. [SOLVED] Set Userform Checkbox value to True if CheckBox.Caption string is found in another String
    By TFiske in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2018, 03:39 PM
  3. CheckBox in Userform
    By sijostephen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-31-2017, 12:44 AM
  4. [SOLVED] Make Worksheet Active-X CheckBox value same as Userform CheckBox value
    By L plates in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-21-2016, 08:23 AM
  5. [SOLVED] Userform - checkbox
    By Lukael in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-11-2014, 01:49 PM
  6. Get UserForm checkbox caption and pass to another UserForm on click or mouse down
    By tulsaguy71 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-08-2013, 11:07 AM
  7. UserForm and CheckBox
    By zplugger in forum Excel General
    Replies: 4
    Last Post: 12-05-2011, 10:39 AM

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