Results 1 to 4 of 4

Command Button disabled until checkbox selected

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    430

    Command Button disabled until checkbox selected

    Good Morning Folk

    I have a userform that will open when the workbook opens. It has two checkboxes and a command button. I am looking for the command button to be disabled until one of the checkboxes is selected.

    The checkboxes are working ok however the command button is enabled at all times and selecting it without selecting a checkbox throws up an error in the 'cmdenter.Enabled = False' line

    This is the code I have so far, can someone point out where I have went wrong,, many thanks

    Sub Workbook_Open()
    
        frmopen.Show
    
        If cboxincident Then
            cmdenter.Enabled = True
        End If
        If cboxcapa Then
            cmdenter.Enabled = True
        End If
            If Not cboxincident And Not cboxcapa Then
                cmdenter.Enabled = False
        End If
    
    End Sub
    Many thanks for your help
    Last edited by JamesT1; 12-06-2013 at 05:54 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Command button grayed out till option button selected
    By Jeff121 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2013, 11:00 AM
  2. clearing a checkbox wth command button
    By shakey775 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2012, 05:37 PM
  3. Command Button to clear checkbox
    By zplugger in forum Excel General
    Replies: 2
    Last Post: 06-26-2011, 09:36 AM
  4. Checkbox choices that run code on clicking command button
    By Sharky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2007, 05:30 PM
  5. deleting a row with checkbox and command button
    By student123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-06-2005, 02:19 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