+ Reply to Thread
Results 1 to 11 of 11

Hiding/Showing Rows With Combobox

  1. #1
    Registered User
    Join Date
    11-21-2008
    Location
    Vancouver
    MS-Off Ver
    Office 2013
    Posts
    11

    Hiding/Showing Rows With Combobox

    Hi,

    I am trying to hide/show a static set of rows based on the value chosen within a combobox.

    The combobox has a list of names and one blank. The blank is selected by default, which renders the rows hidden. When a user selects a name in the combobox the rows will be shown.

    I got some help on this, which allowed me to hide the rows when the workbook was activated and when the worksheet was activated, but the code to show/hide the rows based on the combobox value is not working.

    It is:

    Please Login or Register  to view this content.
    I keep getting Compile Error: Invalid use of ME keyword.

    Any ideas?

    This is using a control toolbox combobox and not a form toolbox combobox. If possible, I'd prefer to use the form toolbox combobox as I want to use its Cell Link property to populate a cell with the index of the value chosen for further formulas to work with.

    Thanks!
    Cray
    Last edited by crayadder; 11-21-2008 at 06:42 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Welcome to the Forum, please read the Forum Rules & use Code Tags in future, select the code & use the # button
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    If the code is in the correct place, i.e. the sheet module then the use of Me is correct.
    There is a LinkedCell Property, but you can use the code

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-21-2008
    Location
    Vancouver
    MS-Off Ver
    Office 2013
    Posts
    11
    Apologies for not reading the rules. I have done so.

    Thanks for the help, your solution works great for showing and hiding the rows. However, the value is not showing up in B1. I assume the value of the combobox is the index of the chosen list item?

    thanks,
    Cray

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Have you loaded values uno the ComboBox? Attach the workbook with the combobox & code

  6. #6
    Registered User
    Join Date
    11-21-2008
    Location
    Vancouver
    MS-Off Ver
    Office 2013
    Posts
    11
    Workbook Attached.

    I have populated the combobox with a named ranged in the ListFillRange property.

    Thanks,
    Cray
    Attached Files Attached Files

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Option Explicit needs to be at the top of the module.

    Your code is working, but the combobox is over the top of B2, you can't see the result. I put B1 but it should have been B2. This is correct

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    11-21-2008
    Location
    Vancouver
    MS-Off Ver
    Office 2013
    Posts
    11
    Works!

    Thanks so much for your help,
    Cray

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    No problem, please mark the thread solved & maybe rate the answer

  10. #10
    Registered User
    Join Date
    11-21-2008
    Location
    Vancouver
    MS-Off Ver
    Office 2013
    Posts
    11
    This has been solved.

  11. #11
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You need to use the Edit button on your first post, then click Go Advanced and you will see a drop down next to the title which allows you to add Solved to the title.

+ Reply to Thread

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