+ Reply to Thread
Results 1 to 5 of 5

Page # of # in frozen cells

  1. #1
    Registered User
    Join Date
    05-16-2014
    MS-Off Ver
    Excel 2010
    Posts
    3

    Page # of # in frozen cells

    I am working on a spreadsheet with a few frozen rows as the top. I need one of the cells to keep track of the page number, and another cell to keep track of the total number of pages.

    This is what I've come up with so far.

    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer

    Please Login or Register  to view this content.
    Notes:
    -My document is one worksheet with over 1100 lines so far. The first 13 lines are frozen so that they appear on every page when printed. M4 and N4 are in those frozen lines; M4 should display, when printed, the page number (as it would be if I had a header/footer with page numbers, or the same numbers seen when the document is in Page Break Preview) and N4 should display the total number of pages in the document (currently 55 pages).

    -The newest code above correctly counts the number of pages in the document and displays that in N4, but it also puts 55 in M4 instead of 1,2,3,... as I want it to. I've tried using the solution posted at http://answers.microsoft.com/en-us/o...2-6dea1ba813f9 but it doesn't seem to work since M4 is in the frozen rows at the top.

    -This is the first macro I've ever worked on, so excuse my lack of knowledge
    Last edited by 6StringJazzer; 05-16-2014 at 11:28 AM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Page # of # in frozen cells

    Hi, 8OutOf10Dogs,

    AFAIK frozen rows will only be displayed on top if you scroll in the worksheet but won´t be printed oin top of each pritnout (that you be the command PrintTitleRows).

    ...but it also puts 55 in M4 instead of 1,2,3,... as I want it to.
    The code is fine you just fail to tell VBA to print out each individual page so you will be presented with the result of the last page in that cell.


    Maybe try:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    05-16-2014
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Page # of # in frozen cells

    Thank you so much Holger!

    One last question, is there any way to change the code so that it will print my document on both sides of the paper?

    Thanks,
    Amina

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Page # of # in frozen cells

    Hi, Amina ,

    do you will trigger a printer that has the capability to print duplex or do you need the code to print the odd side first, change the paper and then print the even ones?

    Please Login or Register  to view this content.
    Ciao,
    Holger

  5. #5
    Registered User
    Join Date
    05-16-2014
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Page # of # in frozen cells

    My printer is capable of printing duplex.

    I can't thank you enough for all your help, Holger!

+ 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. Printing Frozen panes on every page
    By djchapple in forum Excel General
    Replies: 1
    Last Post: 04-25-2012, 06:07 AM
  2. Printing Frozen Cells Automatically on every page
    By gin2000 in forum Excel General
    Replies: 2
    Last Post: 07-17-2006, 01:14 PM
  3. How do I print frozen panes on each page as a header?
    By cmaurer in forum Excel General
    Replies: 1
    Last Post: 03-08-2006, 08:30 PM
  4. Saving as web page for workbook with frozen panes
    By tawne in forum Excel General
    Replies: 0
    Last Post: 01-19-2005, 04:06 PM
  5. Saving workbook with frozen panes as web page htm
    By Tawne in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-19-2005, 04:06 PM

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