+ Reply to Thread
Results 1 to 9 of 9

Help with hiding or unhiding multiple ranges of rows based on cell value on another sheet

  1. #1
    Registered User
    Join Date
    09-19-2012
    Location
    Philadelphia, US
    MS-Off Ver
    Excel 2010
    Posts
    9

    Help with hiding or unhiding multiple ranges of rows based on cell value on another sheet

    Hello all,

    I currently have a macro that auto-filters information on a sheet (Sheet1) based on a drop-down selection. I now need to modify this macro or create an additional macro that will hide two ranges of rows on a second sheet (Sheet2) based on the same drop-down. The current auto-filter is:

    Sub DropDown2_Change()

    Sheets("Page 2").Range("A9").AutoFilter Field:=1, Criteria1:=Cells(Cells(3, 19).Value, 19).Value

    End Sub

    Can anyone show me how to modify the above macro to hide rows 100:120 and 160:180 on sheet2 based on the drop-down (value in cell S19) on sheet1?

    I'm fairly new to this so any help at all would be greatly appreciated.

    Thanks,

    Jake
    Last edited by Jake Bierly; 07-22-2013 at 12:16 PM. Reason: Solved

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Help with hiding or unhiding multiple ranges of rows based on cell value on another sh

    what do you mean by 'based on the drop-down value'? what determines hidden vs visible?
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    09-19-2012
    Location
    Philadelphia, US
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Help with hiding or unhiding multiple ranges of rows based on cell value on another sh

    The drop-down menu only contains two choices. One of the choices generates a "1" and the other a "2" in cell S19 on sheet one. I want to hide the rows I referenced in sheet 2 if the value in cell S19 on Sheet1 is a "1".

    Thanks for your help!

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Help with hiding or unhiding multiple ranges of rows based on cell value on another sh

    add
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-19-2012
    Location
    Philadelphia, US
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Help with hiding or unhiding multiple ranges of rows based on cell value on another sh

    So sorry - I made a few errors when describing the details. The ranges are different and I changed the condition in cell S3, not S19 on sheet "Page 2" to the value "2".

    I added the code but modified the sheet name after I realized I had changed it. There are no errors when running but the rows do not hide when cell S3 on sheet "Page 2" = 2.


    Please Login or Register  to view this content.
    I appreciate the help.

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Help with hiding or unhiding multiple ranges of rows based on cell value on another sh

    perhaps you could post a workbook-I'm no longer sure where anything is!

  7. #7
    Registered User
    Join Date
    09-19-2012
    Location
    Philadelphia, US
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Help with hiding or unhiding multiple ranges of rows based on cell value on another sh

    Sure. Sorry for the confusion. I've uploaded an example of what I was talking about. I'm trying to hide the ranges I mentioned before based on the Residential or Commercial drop-down. I want to hide rows 110:116 and 128:136 on the "CF" tab when "Commercial" is selected on the "Page 2" tab.Filter Code.xlsm

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Help with hiding or unhiding multiple ranges of rows based on cell value on another sh

    gotcha-that line oughta be
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    09-19-2012
    Location
    Philadelphia, US
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Help with hiding or unhiding multiple ranges of rows based on cell value on another sh

    Works flawlessly. Thank you so much for your help.

+ 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. Hiding and unhiding worksheets based on a cell value from another worksheet
    By J_barber in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-05-2013, 01:02 PM
  2. [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
  3. [SOLVED] Hiding / unhiding pictures based on cell value
    By supern0va in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-14-2012, 12:00 PM
  4. Hiding Unhiding Rows based on Text condition
    By Winner_texas in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-11-2010, 11:54 AM
  5. Hiding / Unhiding rows when multiple cell values change
    By waverider in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-09-2006, 08:35 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