+ Reply to Thread
Results 1 to 3 of 3

I need help with an Excel Checkbox.

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-08-2008
    Location
    New York City
    MS-Off Ver
    2013-2016
    Posts
    159

    I need help with an Excel Checkbox.

    Hello,

    I can't get a checkbox in Excel to work. I know little VBA and can't figure out the code to accomplish what I need.
    I have the Checkbox (Form Control) on the sheet and I created a UserForm to enter some data in it.
    What I want is that when I check the box, it loads the user form.
    I tried putting code in a module and linking the box to it, but it threw an error about a variable not set.
    I don't know how to proceed.

    This is what I used to open the form:

    Load AgentForm
    AgentForm.Show
    Any help will be appreciated.
    Thank you.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,442

    Re: I need help with an Excel Checkbox.

    Option Explicit
    
    Private Sub CheckBox1_Click()
        If CheckBox1.Value = True Then
               AgentForm.Show
        Else
               AgentForm.Hide
        End If
    End Sub
    Use an ActiveX checkbox on the sheet. Paste the above macro in the Sheet Module. In PROPERTIES settings for the userform, make the form Non-Modal.

  3. #3
    Forum Contributor
    Join Date
    07-08-2008
    Location
    New York City
    MS-Off Ver
    2013-2016
    Posts
    159

    Re: I need help with an Excel Checkbox.

    I was making it too complicated. It works.
    Thanks Logit!

+ 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] 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
  2. Select All Checkboxes Checkbox That Also Calls Checkbox Macros
    By Intervigilium in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-23-2015, 06:41 PM
  3. Protect the sheet but the form checkbox still can be change and sort by checkbox
    By carolyn1221 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-19-2014, 01:08 PM
  4. Replies: 0
    Last Post: 04-07-2014, 12:22 PM
  5. Lock cell linked to checkbox when checkbox is ticked
    By simeony003 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-30-2013, 10:08 AM
  6. Replies: 4
    Last Post: 07-22-2013, 01:37 PM
  7. [SOLVED] How do I change a checkbox to unchecked without running the code within the checkbox
    By jsunnb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-27-2012, 09:28 PM

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