+ Reply to Thread
Results 1 to 6 of 6

macro for hiding and unhiding rows based on a dropdown selection and cell value

  1. #1
    Registered User
    Join Date
    08-17-2015
    Location
    Beckley, WV
    MS-Off Ver
    2013
    Posts
    2

    macro for hiding and unhiding rows based on a dropdown selection and cell value

    New to macros. This one worked when I first wrote it, but since adding data to the sheet it no longer works. Can someone please help me here? When Yes is selected in cell A2, i want it to hide all rows with no value in column I. When no is selected, I need it to unhide all. Thanks in advance for the help.

    Book1.xlsm

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,026

    Re: macro for hiding and unhiding rows based on a dropdown selection and cell value

    Try this macro. You don't need the Hide and Unhide macros.
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: macro for hiding and unhiding rows based on a dropdown selection and cell value

    Your code appears to hide row 2. Maybe you want to have your begin row be farther down. I added a couple of things to hopefully speed up the code.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: macro for hiding and unhiding rows based on a dropdown selection and cell value

    I removed the code I posted because after further testing I realized the code would run after making a change in column I instead of when A2 was changed. And others posted solutions already
    Last edited by gmr4evr1; 08-17-2015 at 01:14 PM.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,057

    Re: macro for hiding and unhiding rows based on a dropdown selection and cell value

    Maybe this:

    Please Login or Register  to view this content.

    Note there are a few changes to both subroutines.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,057

    Re: macro for hiding and unhiding rows based on a dropdown selection and cell value

    Thanks for the rep.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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] hiding/unhiding rows based on a selection from a drop down
    By jenetic03 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-22-2014, 10:49 AM
  2. Hiding and unhiding rows based on number of cell values
    By juliettelam in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-16-2014, 07:48 PM
  3. Hiding and unhiding rows based on a CountA value
    By juliettelam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-15-2014, 12:23 PM
  4. [SOLVED] Unhiding / Hiding rows based on a different cell value
    By gm2612 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-30-2013, 05:15 AM
  5. [SOLVED] Help with hiding or unhiding multiple ranges of rows based on cell value on another sheet
    By Jake Bierly in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-22-2013, 12:14 PM
  6. [SOLVED] Hiding/Unhiding Rows Based on Dropdown Box
    By SubParLlama in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-14-2012, 12:29 PM
  7. Hiding/Unhiding columns based on a dropdown list
    By jim_0068 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-12-2007, 11:57 AM

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