+ Reply to Thread
Results 1 to 5 of 5

Hiding Rows based on Formula result

  1. #1
    Registered User
    Join Date
    10-21-2011
    Location
    Peterborough, UK
    MS-Off Ver
    Excel 2010
    Posts
    6

    Hiding Rows based on Formula result

    Hi Guys,

    I'm having a bit of trouble with this one:

    I'm trying to hide rows based on the selection of a list box...

    Cell C2 contains the list box (Package 1, Package 2 - based on named range from Sheet2)

    What I would like is that if Package 1 is selected, rows 7-9 are hidden and if Package 2 is selected, Rows 5-6 are hidden and 7-9 show)... and I can't get it it to work.

    If I use the Combo Box (Form Control) and use cell link to C2 the following code will work - but only if I manually update C2, not when I select from the combo box:

    Please Login or Register  to view this content.
    Is there any way I can get this to work from selecting in the combo box?

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Hiding Rows based on Formula result

    Have you thought about using a data validation list rather than a combobox?

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    10-21-2011
    Location
    Peterborough, UK
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Hiding Rows based on Formula result

    Hi Domski,

    Yes I've thought about it, and can make it work that way... BUT...

    what I'm being asked to do is a bit outside excel's remit - to create a "questionnaire" that will simply be point and click for the end user, and can be then processed through Access in my office to generate different info for different departments.

    We can't make it browser based for security reasons (I'm told).... and using an access form has also been denied due to compatibility issues.

    Long and short, different questions will be hidden/shown depending on answers to previous questions - one of the next points is that if to this first question "No Package" is to be selected, will be to show the full list of services available with check boxes to select the ones you want for a bespoke package.

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Hiding Rows based on Formula result

    Hi,

    I have to admit I still don't really understand the advantage of using the combobox over a validation list.

    A sample workbook might help.

    Dom

  5. #5
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Hiding Rows based on Formula result

    As a separate point Select Case is probably a better way to write the code for your event:

    Please Login or Register  to view this content.

    Dom

+ 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