+ Reply to Thread
Results 1 to 7 of 7

Userform ComboBox

  1. #1
    Forum Contributor
    Join Date
    10-07-2013
    Location
    Wilts, England
    MS-Off Ver
    Excel 2013
    Posts
    100

    Userform ComboBox

    Hi All,
    I think this is a pretty easy one, but I've tried everything I can think of and looked all over but I just can't crack it.
    I have a very simple user form on my excel wb. It has one combobox and one command button.

    What I wish to do is, based on the selection of 1-4 in the combobox, hide lines on a work book. The code I have so far is;

    Please Login or Register  to view this content.
    Do I have it in the wrong place? Or is it totally wrong?

    Thanks for any help.
    Last edited by beenbee; 07-29-2014 at 05:23 AM. Reason: typo

  2. #2
    Forum Contributor
    Join Date
    09-11-2013
    Location
    Germany
    MS-Off Ver
    Excel 2007
    Posts
    265

    Re: Userform ComboBox

    Quote Originally Posted by beenbee View Post
    Hi All,
    I think this is a pretty easy one, but I've tried everything I can think of and looked all over but I just can't crack it.
    I have a very simple user form on my excel wb. It has one combobox and one command button.

    What I wish to do is, based on the selection of 1-4 in the combobox, hide lines on a work book. The code I have so far is;

    Please Login or Register  to view this content.
    Do I have it in the wrong place? Or is it totally wrong?

    Thanks for any help.
    Should this not be under the CommandButton1_Click()

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Userform ComboBox

    Code is okay but it appears to be in the userform click event procedure.

    If you want the rows visibility to react to actually clicking the combobox you will need to move the body of the code in to the comboboxes change event
    Cheers
    Andy
    www.andypope.info

  4. #4
    Forum Contributor
    Join Date
    10-07-2013
    Location
    Wilts, England
    MS-Off Ver
    Excel 2013
    Posts
    100

    Re: Userform ComboBox

    In response to "Should it not be on CommandButton1_Click()". Thank you for your response. I have tried but it hits me with an "Application-defined or object-defined error".
    Last edited by beenbee; 07-29-2014 at 05:39 AM.

  5. #5
    Forum Contributor
    Join Date
    10-07-2013
    Location
    Wilts, England
    MS-Off Ver
    Excel 2013
    Posts
    100

    Re: Userform ComboBox

    Same issue as stated to the previous poster, "Application-defined or object-defined error". However these cells are populated. Should I be referencing the range differently?

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Userform ComboBox

    Actually try replacing Rows with Range and including EntireRow

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    10-07-2013
    Location
    Wilts, England
    MS-Off Ver
    Excel 2013
    Posts
    100

    Re: Userform ComboBox

    Fixed by removing the B's, thanks for the help.

+ 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] userform: when selecting Combobox value force user to choose from second combobox
    By mortphil in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-31-2014, 12:29 PM
  2. Populating Userform ComboBox Using Items from Content Control Combobox
    By anarxo in forum Word Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2014, 01:00 PM
  3. [SOLVED] Make combobox list options dependant on selection in another combobox within a userform
    By Vladimir_Dobvchenko in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-23-2013, 05:30 AM
  4. [SOLVED] send data from userform combobox to userform combobox
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-18-2013, 04:47 PM
  5. [SOLVED] Excel Userform: Populate other controls (i.e. textbox & combobox) based on combobox select
    By MileHigh_PhD in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-22-2013, 04:50 PM

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