+ Reply to Thread
Results 1 to 10 of 10

Can you hide and unhide Rows on a worksheet based on their print page number?

  1. #1
    Registered User
    Join Date
    09-14-2012
    Location
    Yorkshire, England
    MS-Off Ver
    Windows 10 using Excel 2021
    Posts
    14

    Question Can you hide and unhide Rows on a worksheet based on their print page number?

    Hi all, long time since the last vist. Glad to see you're still up and running and going strong.

    The reason for this visit is I am trying to sort a macro to only show Rows based on print page numbers but am not having any luck at all. I'm not even sure if its possible.

    For example, I have a years worth of schedules on one worksheet set out at 52 week intervals using a page break to seperate the weeks for individual printing.

    The entire 52 weeks needs to be hidden but a user needs to be able to see two (2) weeks worth of schedules at a time so they can work on them prior to issuing.

    Is there any way that a macro can be used that will allow (Unhide) all Rows from the requested print page numbers?


    Many thanks and I look forward to any response.
    Last edited by BlindB; 05-03-2025 at 02:23 AM.
    No Problems, Only Solutions

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    8,046

    Re: Is it actually possible?

    Quite possibly possible.
    But a sample workbook would go a long way to explaining the ask here.

    BSB

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,920

    Re: Is it actually possible?

    Administrative Note:

    It's been a long time since your last visit, so please re-read the forum rules, especially our guideline on thread titles (yours is not very helpful).

    Is your forum profile up-to-date and showing ONLY the oldest Excel PRODUCT that you need this to work for?

    Members will tailor the solutions they offer to the Office PRODUCT (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your product is for Mac, please also state this.

    The four most recent Excel products are Excel 2019, Excel 2021, Excel 2024 and MS365 - if you are using MS365, please give this name along with the version number in your profile (e.g. MS365 Version 2306). This is in the About Excel section further down the Account page.

    Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    09-14-2012
    Location
    Yorkshire, England
    MS-Off Ver
    Windows 10 using Excel 2021
    Posts
    14

    Re: Is it actually possible?

    Hello AliGW, hope this finds you well.

    Appreciate the input, hopefully now all up to date.


    Many thanks

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,920

    Re: Can you hide and unhide Rows on a worksheet based on their print page number?

    Great - we are all set now.

    So, are you able to provide a sample workbook, as requested in post #2? There's a link in the banner at the top of the page to a FAQ, in case you are not sure how to do this.

  6. #6
    Registered User
    Join Date
    09-14-2012
    Location
    Yorkshire, England
    MS-Off Ver
    Windows 10 using Excel 2021
    Posts
    14

    Re: Is it actually possible? (now has a new title)

    Hi BadlySpelledBuoy, appreciate you taking a look.

    Due to Privacy regulations in the UK I have attached a smaller version limited to several weeks with minimal input (Names) for your perusal/advice.

    As you can see the input effectively runs from week to week. All weeks will be represented on this worksheet from 1 - 52 and are seperated by page breaks.

    What i am trying to achieve is that, effectively all rows will remain hidden, but when a particular week is requested any rows on the page week will unhide, allowing the user to update/alter the information.

    The reason I have based it like this is that input/allocation of resources varys from week to week but keeping like this make it easier to locate, adjust and print.


    Hope that makes a bit more sense? and many thanks for your time.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    09-14-2012
    Location
    Yorkshire, England
    MS-Off Ver
    Windows 10 using Excel 2021
    Posts
    14

    Re: Can you hide and unhide Rows on a worksheet based on their print page number?

    Hi AliGW,

    I have answered BadlySpelledBuoy's post and attached a sample to his post.

    Does this mean anybody will be able to use this or do I need to also post it elswhere?


    Thanks

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,920

    Re: Can you hide and unhide Rows on a worksheet based on their print page number?

    You are not able to edit another member's post. The sample workbook is attached to your own post (post #6) and anyone can access it. Thanks.

    Now you just need to wait until someone has a suggestion for you.

  9. #9
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Can you hide and unhide Rows on a worksheet based on their print page number?

    In the InputBox select the 1st of 2 weeks you want to see.
    Please Login or Register  to view this content.
    PS: VBA in your example file is password protected.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  10. #10
    Registered User
    Join Date
    09-14-2012
    Location
    Yorkshire, England
    MS-Off Ver
    Windows 10 using Excel 2021
    Posts
    14

    Re: Can you hide and unhide Rows on a worksheet based on their print page number?

    Hello Bakerman2, apologies for the tardyness of my reply, works litterally killing me at the moment.

    Appreciate you getting back to me. I will give this a look in and whirl over the weekend.


    Many thnaks

+ 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