+ Reply to Thread
Results 1 to 6 of 6

Display/Hide textboxes with combobox and VBA

  1. #1
    Registered User
    Join Date
    10-24-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    56

    Post Display/Hide textboxes with combobox and VBA

    Hi,

    In the Useform I have a ComboBox with drop down options "1 to 12". When you select a number a NameBox and CompanyBox become visible. The number of NameBox and CompanyBox become visible depend on the number selected int he ComboBox. How can I shorten this code:

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Display/Hide textboxes with combobox and VBA

    Please Login or Register  to view this content.
    Last edited by Tinbendr; 04-22-2013 at 03:00 PM.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    10-24-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: Display/Hide textboxes with combobox and VBA

    Hi David,

    Thanks for your reply,

    However that didnt work, various NameBoxs and CompanyBoxs appear as you choose different number from dropbox.

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Display/Hide textboxes with combobox and VBA

    Oops! That should be

    Please Login or Register  to view this content.
    Last edited by Tinbendr; 04-22-2013 at 03:54 PM.

  5. #5
    Registered User
    Join Date
    10-24-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: Display/Hide textboxes with combobox and VBA

    Hi David,

    The correction worked but i would like to show this:

    When 3 is selected i see:

    NameBox CompanyBox
    NameBox CompanyBox
    NameBox CompanyBox

    Right now when i select 3, only third line is displayed

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Display/Hide textboxes with combobox and VBA

    Hi Kaurka,

    Try this:

    Please Login or Register  to view this content.
    Last edited by xladept; 04-22-2013 at 06:46 PM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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