+ Reply to Thread
Results 1 to 4 of 4

Need help with a Worksheet_Change sub (hide/unhide rows based on cell value)

  1. #1
    Registered User
    Join Date
    05-03-2006
    Posts
    37

    Need help with a Worksheet_Change sub (hide/unhide rows based on cell value)

    Very simple piece of code that hides or unhides specific rows based on the value in specific cells.

    The first set looks at the value in cell O19 and then hides and unhides specific rows (in 24:28) based on whether cell O19 has values: "", "ONE", "TWO", "THREE" or "FOUR". If none are true then it unhides all rows 24:28.

    The second set looks at the value in cell O47 and then hides and unhides specific rows (in 52:56) based on whether cell O47 has values: "", "ONE", "TWO", "THREE" or "FOUR". If none are true then it unhides all rows 52:56.


    The problem is that the first set works fine (i.e. when I change the value in O19).

    The second set is not working (i.e. when I change the value in cell O47, nothing happens).

    Both sets of code need to work independent of each other (if that makes sense).

    Can anyone help?

    The code is as follows...

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Need help with a Worksheet_Change sub (hide/unhide rows based on cell value)

    Hello happyfingers,

    The Code works for me. The only thing is, how do you intend un-hiding Rows which are hidden with an empty Cell?

    I have created a Named Range with Dropdown Validation Boxes in O19 and O47 respectively, and changed the "" value To """".

    Please try the attached sample Workbook.

    Regards.
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Registered User
    Join Date
    05-03-2006
    Posts
    37

    Re: Need help with a Worksheet_Change sub (hide/unhide rows based on cell value)

    Thanks Winon. That seems to have done the trick. I really appreciate your response. Very very much appreciated!

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Need help with a Worksheet_Change sub (hide/unhide rows based on cell value)

    Thank you for the feedback, and for adding to my reputation.

    Glad I could help.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Thanks.

+ 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. VBA to hide and unhide rows based on a cell value in the row
    By Preacher63 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-03-2015, 04:13 PM
  2. how To hide/unhide rows based on cell value
    By novice2430 in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 06-05-2013, 01:39 PM
  3. Hide/Unhide rows based on cell value in each row
    By Drewf2000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-22-2013, 07:11 AM
  4. Hide/Unhide rows based on Cell Value
    By noelwri in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-28-2012, 04:25 PM
  5. Hide/Unhide Rows Based On Cell Value
    By ZooTV92 in forum Excel General
    Replies: 5
    Last Post: 09-05-2011, 07:51 AM
  6. Unhide / Hide Rows Based on Cell Value
    By bradaresnick in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 03-02-2010, 10:02 AM
  7. hide/unhide rows based on cell value
    By alexandruc in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 10-12-2009, 06:49 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