+ Reply to Thread
Results 1 to 7 of 7

Please help me automatically hide rows in attached workbook.

  1. #1
    Registered User
    Join Date
    03-13-2013
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2007, Excel 2004
    Posts
    3

    Question Please help me automatically hide rows in attached workbook.

    Hello:

    I want to automatically hide/unhide rows in the attached workbook,
    according to the following (pseudo) pseudo-code:

    Please Login or Register  to view this content.
    Would somebody be kind enough to provide specific instructions for me to accomplish the above?
    I know there are a number of similar posts, but after studying several of them,
    along with related help topics, I'm still stuck.
    I would really appreciate any help. I'm a bit of a hack, and working hard to learn
    the advanced concepts I need in order to create a solution I'm working on.

    TIA,

    Netx
    Attached Files Attached Files

  2. #2
    Forum Contributor yay_excel's Avatar
    Join Date
    08-12-2011
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    190

    Re: Please help me automatically hide rows in attached workbook.

    Without viewing your attachment, the correct code would be:

    Please Login or Register  to view this content.

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Please help me automatically hide rows in attached workbook.

    Hi Netx,

    Here's your code:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Registered User
    Join Date
    03-13-2013
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2007, Excel 2004
    Posts
    3

    Re: Please help me automatically hide rows in attached workbook.

    Thank you both very much! Now I'm trying to figure out how to get the code to run automatically.
    Actually, now I have it working automatically. Could you tell me if what I did below is 100% correct,
    or if I should do anything slightly differently?

    This is my first experience with VBA, so I took a guess and blindly opened the
    VB editor, then pasted @xladept's code into the window. A macro now shows up named 'Netx'
    Upon running the Netx macro, everything worked as hoped for, but I need it to respond anytime
    the state of the condition changes.

    After looking at the VBA documentation, I took another guess, and modified the code slightly, as below:

    Please Login or Register  to view this content.
    Now, anytime the values change, the rows hide or unhide as desired. Hurray!
    Not sure, however, if I should have done it a different, better way, or if this is
    a perfectly fine way to do it.

    Thanks again,

    Netx

  5. #5
    Forum Contributor yay_excel's Avatar
    Join Date
    08-12-2011
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    190

    Re: Please help me automatically hide rows in attached workbook.

    That way will work just fine. You could also have the code triggered by the change event for Sheet1. This would be more efficient as the code would only run when values on Sheet1 change, instead of any time there is a change in the entire workbook. If you're not experiencing any issues with speed you should be fine the way you have it.

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Please help me automatically hide rows in attached workbook.

    I agree with yay! The only thing that might bug you in the future is if the event procedure keeps getting triggered - not much risk of that with this routine - but, be aware that:

    Please Login or Register  to view this content.
    Are standard enveloping code for event procedures

  7. #7
    Registered User
    Join Date
    03-13-2013
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2007, Excel 2004
    Posts
    3

    Re: Please help me automatically hide rows in attached workbook.

    Thanks again to both of you - I really appreciate it!

+ 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