+ Reply to Thread
Results 1 to 6 of 6

Macro the hides entire rows based on a drop down list

  1. #1
    Registered User
    Join Date
    07-22-2009
    Location
    Clio
    MS-Off Ver
    Excel 2003
    Posts
    9

    Macro the hides entire rows based on a drop down list

    First, thank you for any help you can give. I'm not the best at creating macros, so I need help with this one.

    I have a drop down list in cell I3 with a range of numbers from 0-8. If 0 is selected I want to hide rows 14-69.

    If 1 is selected hide rows 21-69
    If 2 is selected hide rows 28-69
    If 3 is selected hide rows 35-69
    If 4 is selected hide rows 42-69
    If 5 is selected hide rows 49-69
    If 6 is selected hide rows 56-69
    If 7 is selected hide rows 63-69
    If 8 is selected hide rows No hidden Rows

    I also need this macro to work to work it the worksheet is coppied into the same workboob multiple times. Is this possible? Thank you for your help!

  2. #2
    Forum Contributor
    Join Date
    08-27-2009
    Location
    South Africa
    MS-Off Ver
    Office 2010
    Posts
    217

    Re: Macro the hides entire rows based on a drop down list

    Does does help?

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Sniper; 09-10-2009 at 10:39 AM.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Macro the hides entire rows based on a drop down list

    Something like:

    Please Login or Register  to view this content.
    To insert the above right click on tab against which the code is to be applied - select View Code and insert into resulting window thereafter ensure Macros are enabled.

    Quote Originally Posted by MGK086
    I also need this macro to work to work it the worksheet is coppied into the same workboob multiple times.
    if you right click on tab and select to Copy you should find the code will fire on the replica sheet also (separate events - ie the copied sheet does not affect original and vice-versa)
    Last edited by DonkeyOte; 09-10-2009 at 10:51 AM. Reason: error in code re: 8... removed

  4. #4
    Registered User
    Join Date
    07-22-2009
    Location
    Clio
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Macro the hides entire rows based on a drop down list

    That worked great Thanks!!!

  5. #5
    Registered User
    Join Date
    08-13-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Macro the hides entire rows based on a drop down list

    Hi there,

    I found this thread extremely useful as I needed to hide rows depending on a drop-down cell number.

    But what if you have more than one drop-downs on the same sheet and consequently more than one set of rows that need to be hidden? Is it possible to adjust the VBA code to accommodate this?

    Thank you,
    annie_an
    Last edited by Cutter; 08-14-2012 at 03:30 PM. Reason: Removed whole post quote

  6. #6
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: Macro the hides entire rows based on a drop down list

    Hi. Welcome to the forum

    Yes it is. You should make your own thread and post a sample file for people to see, asking in someone else's thread is against forum rules.

    2. Don't post a question in the thread of another member -- start your own. If you feel it's particularly relevant, provide a link to the other thread.
    Also:

    12. Don't quote whole posts -- it's just clutter. If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding.
    .?*??)
    `?.???.?*??)?.?*?)
    (?.?? (?.?
    Pichingualas <---
    ??????????????????????????

    Wrap your code with CODE TAGS.
    Thank those who helped you, Don't forget to add to their REPUTATION!!! (click on the star below their post).
    Please mark your threads as [SOLVED] when they are (Thread Tools->Mark thread as Solved).

+ 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