Results 1 to 2 of 2

Hide button within userform if Combobox is blank

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    Hide button within userform if Combobox is blank

    HI,

    I have a ComboBox1 has populate other textbixes etc on a userform. The user then has the option to edit the existing data (CommandButton1) or Create new data (CommandButton2).

    If there is nothing entered into ComboBox1 then I would like to hide CommandButton1 from my form. Is this possible?

    I have tried some code but cannot get it working:

         Private Sub UserForm_Initialize()
    Dim ws As Worksheet
    
                With Me.Controls("CommandButton2")
    
                    If mename.Value = "" Then
    
                        .Visible = False
    
                    Else
                
                        .Visible = True
    
                    End If
    
                End With
    This hides the button but doesn't show it when text is entered into ComboBox1 (mename)

    Thank you in advance
    Last edited by jpruffle; 05-18-2009 at 11:44 AM.

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