+ Reply to Thread
Results 1 to 2 of 2

How to auto update a given cell with page number when printing and a page break is reached

  1. #1
    Registered User
    Join Date
    01-24-2013
    Location
    Her
    MS-Off Ver
    Excel 2003
    Posts
    2

    How to auto update a given cell with page number when printing and a page break is reached

    Hi

    there seems to be quite some ideas out there for how to solve my problems, but I really cant seem to make any of them to work

    What I need, and many with me, would be a VBA function that, when a sheet is printed, is able to update a cell, that is repeated on each paper printed, with the current page number. This could be solved in sofisticated ways by counting page breakes and so on and determine wich range of cells is printed right now and i between which breaks they reside. This is really not needed. All one actually need is a counter that increments by one each time a new paper is printed. I hope. And which interacts such way that the wanted cell is updated with a new value.

    Now. I do have a function, TotalPages(), that determines the total number of pages in the active sheet, and which also works,
    and I also have a function named ThisPage() to give the current page. This does not work.

    In the cells at top of my sheet which I have selected to be reprinted on each page I have one cell with the following formula.

    Please Login or Register  to view this content.
    When I force ThisPage() to return a fixed number, say 1, the cell will be given the value

    Please Login or Register  to view this content.
    For a 3 paged sheet, So this is the choosen format I want to have the information printed.

    But, When One do print a sheet, I guess there must be some mechanism to update the same cell with new numbers each time a set page break is reached. I dont know how that should be done at all, so please give some hints if possible at all.

    Maybe I must create a new function that print the entire string in one and which is called each time excells printer driver routine is called and which updates the cell with correct data each time a page break is reached. But I really do not know where to start.


    If you can contribute , please fill in. I have read quite some examples on similar things these last few days but I have not found any solution yet. Well, atleast no solution that actually works.


    Best regards and thanks in advance
    Vidar (Z)

  2. #2
    Registered User
    Join Date
    01-24-2013
    Location
    Her
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: How to auto update a given cell with page number when printing and a page break is rea

    Bump? .

+ 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