+ Reply to Thread
Results 1 to 9 of 9

Multiple "Worksheet Change" Instructions

  1. #1
    Registered User
    Join Date
    06-16-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 365
    Posts
    6

    Question Multiple "Worksheet Change" Instructions

    Hi all. Very new to VBA but I'm hoping someone can help me out here because I've got stuck...

    I want to automatically hide columns based on the contents of a drop down list and then automatically hide rows based on the same criteria. I've worked out how to do either one on its own but can't seem to combine the 2 without error. I've pasted the code I'm using below. Each section (that starts "Private Sub Worksheet...") works on its own but not when I try do both at the same time (as below). B2 hold the contents of a drop down list.

    Any help would be much appreciated!

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    08-01-2013
    Location
    Verona - Italy
    MS-Off Ver
    Excel 2007-2010-2013
    Posts
    33

    Re: Multiple "Worksheet Change" Instructions

    What about trying to write a unique macro working on columns and rows to hide at the same time?

  3. #3
    Registered User
    Join Date
    06-16-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 365
    Posts
    6

    Re: Multiple "Worksheet Change" Instructions

    Thanks, but not sure what you mean???

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    UK
    MS-Off Ver
    2016 primarily
    Posts
    3,959

    Re: Multiple "Worksheet Change" Instructions

    Something like this:

    Please Login or Register  to view this content.
    Rory
    Days when we raged, we flew off the page
    Such damage was done

  5. #5
    Registered User
    Join Date
    06-16-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 365
    Posts
    6

    Re: Multiple "Worksheet Change" Instructions

    Awesome, thanks Rorya.

    Is there a way to amend it so that when I select "All" in the B2 drop down list that columns and rows get UN hidden?

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    UK
    MS-Off Ver
    2016 primarily
    Posts
    3,959

    Re: Multiple "Worksheet Change" Instructions

    Try this:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    08-01-2013
    Location
    Verona - Italy
    MS-Off Ver
    Excel 2007-2010-2013
    Posts
    33

    Re: Multiple "Worksheet Change" Instructions

    I meant exactly what rorya has written

  8. #8
    Registered User
    Join Date
    06-16-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 365
    Posts
    6

    Re: Multiple "Worksheet Change" Instructions

    Perfect - thanks guys.

  9. #9
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    UK
    MS-Off Ver
    2016 primarily
    Posts
    3,959

    Re: Multiple "Worksheet Change" Instructions

    Glad to help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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