Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    May 2004
    Location
    Toronto, Ontario, Canada
    Posts
    425
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Checkbox (Excel 97)

    Hi all,

    I need some help with code, I'm new to VBA !
    What I would like to do is load a userform, from a checkbox,
    if the check is true, then the form appears, I would like it to hide itself once the new form appears.
    Can anyone help me?

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Checkbox (Excel 97)

    Not sure what you are after. You could do the same with a button without all the checking the values

    This code added to a checkbox from the controltoolbox onto a sheet (the code goes into the worksheet module in VB

    <pre>Private Sub CheckBox1_Click()
    If CheckBox1.Value = True Then
    ActiveSheet.CheckBox1.Visible = False
    UserForm1.Show
    End If
    End Sub</pre>


    Then add these lines of code to make the checkbox visible and remove the check (perhaps on the userform termination event)
    <pre> ActiveSheet.CheckBox1.Visible = True</pre>


    Change the name of the userform and checkbox as appropriate.

    Steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •