Results 1 to 4 of 4

Checkbox in Userform

Threaded View

NewYears1978 Checkbox in Userform 08-25-2020, 04:11 PM
6StringJazzer Re: Checkbox in Userform 08-25-2020, 04:36 PM
NewYears1978 Re: Checkbox in Userform 08-25-2020, 05:28 PM
6StringJazzer Re: Checkbox in Userform 08-26-2020, 08:09 PM
  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
    Private Sub CheckBox1_Click()
    If UserForm1.CheckBox1.Value = True Then
           MsgBox "Checkbox has Checked", , "Checkbox"
        Else
           MsgBox "Checkbox has UnChecked", , "Checkbox"
        End If
    End Sub
    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
    Sub test()
    
    If UserForm1.CheckBox1.Value = False Then
    UserForm1.Show
    Else
    End If
    End Sub
    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.

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