+ Reply to Thread
Results 1 to 3 of 3

Worksheet Change - Unhiding variable amount of rows

  1. #1
    Registered User
    Join Date
    12-20-2019
    Location
    South Dakota
    MS-Off Ver
    365
    Posts
    56

    Worksheet Change - Unhiding variable amount of rows

    I want to build a worksheet change function that will unhide a variable amount of rows.

    If the value in a cell, say A1, is changed then it will hide that amount of rows in seven different areas along the sheet. So I type in 30 and rows 16:45, 91:120, 166:195, 241:270, 316:345, 391:420, and 466:495 would all become visible. Or if I type in 45 then rows 16:60, and etc would become visible; or type in 60 and rows 16:75, and etc would become visible.

    I know I could build a worksheet change function that will vary from any input to unhide each row individually; I just don't want a code that would have 180 variables and have to individually name 1260 different cell ranges.

    P.S. The row examples I gave are obviously from my current sheet, which is set to have 1-60 in seven different segments - technically I want it to be 1-120 or 1-180 instead of having to manually add in the extra rows when needed.

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Worksheet Change - Unhiding variable amount of rows

    I'm not really sure if I understand all of your problem but here is a start.
    The macro will first hide all rows in this range :A16:A1000
    Then, it will unhide the rows as you specified.
    Please Login or Register  to view this content.
    See attach file
    Attached Files Attached Files
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Worksheet Change - Unhiding variable amount of rows

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

+ 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. [SOLVED] Inserting a variable amount of Rows
    By BryceVBA in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2017, 11:29 AM
  2. Replies: 2
    Last Post: 06-06-2013, 11:14 PM
  3. How do I combine worksheet changes for hiding/unhiding rows?
    By dennig231 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-20-2013, 11:07 PM
  4. Replies: 2
    Last Post: 07-28-2011, 10:41 PM
  5. Worksheet Protection & Hiding/Unhiding Grouped Rows
    By makku in forum Excel General
    Replies: 2
    Last Post: 07-02-2009, 06:17 AM
  6. 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
  7. [SOLVED] Unhiding hidden rows in a worksheet
    By John Wirt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2005, 01:05 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