+ Reply to Thread
Results 1 to 9 of 9

Unhiding part of a range

  1. #1
    Registered User
    Join Date
    07-31-2008
    Location
    Philadelphia, PA
    Posts
    40

    Unhiding part of a range

    I'm trying to write VBA that will unhide all the rows in a designated range ("Apples"), except the first and the last.

    I'm using this simple code to hide the range:

    Please Login or Register  to view this content.
    but the first line and last line in the range need to remain hidden at all times and I need a similar script that will unhide the rest of the range for me. Any thoughts on a simple, clean way to do that?
    Last edited by petalred; 11-18-2008 at 12:39 PM.

  2. #2
    Forum Contributor
    Join Date
    01-13-2006
    Location
    Texas
    Posts
    161
    Is there an issue with defining a second named range without the first and last rows of "Apples"?

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,430
    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Registered User
    Join Date
    07-31-2008
    Location
    Philadelphia, PA
    Posts
    40
    Oh, and to clarify, the number of rows in the range fluctuates wildly. I need a script that will keep the first and last lines hidden when it reveals the range, regardless of how many rows the range contains.

  5. #5
    Registered User
    Join Date
    07-31-2008
    Location
    Philadelphia, PA
    Posts
    40
    Conor: Sorry, yeah, see my above post (which I must have been posting while you were typing your question).

    Andy: Let me give that a shot! Thanks!

  6. #6
    Registered User
    Join Date
    07-31-2008
    Location
    Philadelphia, PA
    Posts
    40
    Andy, I think you accidentally switched the "False" and the "True," and I caught that before I ran the script and switched them, but the ".Offset" line didn't work. It says "Application-defined or object-defined error." Any thoughts?

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,430
    This works for me
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    07-31-2008
    Location
    Philadelphia, PA
    Posts
    40
    Awesome! That worked! Thanks a lot, Roy!

    Andy, I'll check that out. I'm not sure why it's not working on my sheet. Thanks anyway, though.
    Last edited by petalred; 11-18-2008 at 12:41 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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