+ Reply to Thread
Results 1 to 30 of 30

Using Value in Cell to hide/unhide rows

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    12-05-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010 & 2013
    Posts
    308

    Re: Using Value in Cell to hide/unhide rows

    Hi Maayub

    You could use RESIZE to do this. Again, this would be easier with some more information...

    If you want to keep row 5 and hide rows 6:200 you could use:

    Sheets("Sheet1").Rows(6).Resize(195).Hidden = True
    Hope this is enough of a clue. Clearly, you can put formulae in the place of the 6 and 195 (e.g. Range("A1").Value, etc)

    Cheers, Rob.

  2. #2
    Registered User
    Join Date
    02-02-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Using Value in Cell to hide/unhide rows

    Hi Rob, Thanks for the tip. I did notice the rows disappearing, but they do not resize when i change the values. As per your suggestion, instead of using a constant value in the cell, I referenced the function directly to the cell. In doing so, i hoped that the resizing change automatically. But this was not the case.

    Sub ROWRESIZE()
    Sheets("Sheet1").Rows(1).Resize(Range("A13").Value).Hidden = True
    End Sub
    For the above code, When i set my a13 cell value as 5, rows 1- 5 are hidden. But when i change it to 3, nothing happen. I did include the part on the code that will effect any changes to the cell like you mentioned in your earlier posts, but nothing happen. Any idea what i'm doing wrong?

    Thanks, Rob.

    Ayub

+ 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