1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Hiding rows based on range content

Discussion in 'Business Applications' started by glbcpa, Nov 27, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. glbcpa

    glbcpa Thread Starter

    Joined:
    Oct 31, 2007
    Messages:
    17
    How can I hide rows based on the selection of a Data Validation in Excel.

    Example:

    If user chooses 1 from drop-down menu then hide rows 15-20 otherwise if 2 is chosen hide rows 25-35. I have a proc that will hide the rows but I don't know how to get the code to fire.

    Thanks
     
  2. The Villan

    The Villan

    Joined:
    Feb 20, 2006
    Messages:
    2,255
    If you had a column called code and entered against each record 1, 2 3, etc, you could then use the Data auto filter to do the rest. Just a thought after visitors forced me to have too much to drink hic LOL.
     
  3. Zack Barresse

    Zack Barresse

    Joined:
    Jul 25, 2004
    Messages:
    5,452
    Hi, welcome to the board!

    I would go with what Villan says with AutoFilter. Otherwise, try explaining to us the purpose of what you're trying to do.
     
  4. glbcpa

    glbcpa Thread Starter

    Joined:
    Oct 31, 2007
    Messages:
    17
    I have a drop down that has "Corporation", "Partnership" as the two elements. I have used a Data Validation List for input into that cell.

    Underneath I have rows that describe the type of income from each entity taken from their respective tax returns (Form 1120 or Form 1065). If the user chooses Corporation from the drop-down I want to hide the rows describing the Partnership income amounts since they are irrelavant and I don't want a user inputting anything there thinking it will be included in a calculation of franchise tax liability.

    Thank you for your help.
     
  5. Zack Barresse

    Zack Barresse

    Joined:
    Jul 25, 2004
    Messages:
    5,452
    You can still use the data structure Villan has stated. Just have a column with all of your values being either "Corporation" or "Partnership", then autofilter that column/range as your drop down choice (would actually NOT use Data Validation, just AutoFilter, as the drop down is inherent with filtering).

    If this is not neat enough for you, we can do VBA, but coding should be a last resort. If you still want to do coding we need to know some things, i.e. what your data structure is like, where your header row(s) are (exact ranges), where your data starts and ends (exact range), the last row of your data and if it will change (also how if it changes) and the scope of how you would like this run (i.e. what sheet/book are you running this in).
     
  6. The Villan

    The Villan

    Joined:
    Feb 20, 2006
    Messages:
    2,255
    It should also be stated that you do not lose any of your data using autofilter. It just hides the data you do not want to see. When you click back on Data, Filter, Autofilter it returns you back to the position before you used it.
    Brilliant for fast management accounting analysis.
     
  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/656545

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice