+ Reply to Thread
Results 1 to 6 of 6

Check boxes checked

Hybrid View

  1. #1
    Registered User
    Join Date
    05-26-2010
    Location
    Tennessee, United States
    MS-Off Ver
    Office: Microsoft Office 2007. Home: Microsoft Office 2010
    Posts
    45

    Check boxes checked

    I was just wondering if it was possible to have a user form with check boxes that, after it is closed and reopened, the check boxes are still checked to show what options were chosen by the user. If this is possible, how would someone go about implementing this? I am using Excel 2007 and I don't have an example because it is just something I thought of.

    Thanks in advance.
    Last edited by EGR2317; 06-04-2010 at 02:27 PM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Check boxes checked

    One way is to put a value in a spare Cell Toggle the caption with the checkbox value.

    When the form is Initialized, set the check box to the Cell value
    i.e.
    If Sheet1.Range("AA1")= "TRUE" Then
         Checkbox1.Value = True
    Else
         Checkbox1.Value = False
    End If
    Hope this helps.

    If you need any further information, please feel free to ask further

    However

    If this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody!
    Also
    If you are satisfied by any members response to your problem please consider using the scales icon top right of thier post to show your appreciation.
    Last edited by Marcol; 06-04-2010 at 01:49 PM.

  3. #3
    Registered User
    Join Date
    05-26-2010
    Location
    Tennessee, United States
    MS-Off Ver
    Office: Microsoft Office 2007. Home: Microsoft Office 2010
    Posts
    45

    Re: Check boxes checked

    Thanks, Marcol, but could you explain what your code does, exactly? I'm looking at it and trying to understand, but I could use a little bit of help.

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Check boxes checked

    Hold that result, I've used that before but it seems like it doesn't work!!!
    I'll have to check it out.

    Back soon.

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Check boxes checked

    Silly me of course it does!!!
    I forgot how Excel reads "TRUE"/"FALSE"

    I have appended a demo workbook for you to try.

    The code
    Private Sub CheckBox1_Click()
        If CheckBox1 Then
            Sheet1.Range("AA1") = "True"
        Else
            Sheet1.Range("AA1") = "False"
        End If
    End Sub
    
    Private Sub UserForm_Activate()
        If Sheet1.Range("AA1") = "True" Then
             CheckBox1.Value = True
        Else
             CheckBox1.Value = False
        End If
    End Sub
    Is in the UserForm

    And in the workbook module
    Private Sub Workbook_Open()
        UserForm1.Show
    End Sub

    Cheers
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-26-2010
    Location
    Tennessee, United States
    MS-Off Ver
    Office: Microsoft Office 2007. Home: Microsoft Office 2010
    Posts
    45

    Re: Check boxes checked

    Thanks Marcol. I think I understand how it works now.

+ 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