+ Reply to Thread
Results 1 to 2 of 2

Header Table Page Numbers

Hybrid View

  1. #1
    Registered User
    Join Date
    07-14-2009
    Location
    CT, USA
    MS-Off Ver
    Excel 2016
    Posts
    71

    Header Table Page Numbers

    I have a sort of table that Id like to display on the top of every page. My main problem is the page numbers. I know its hard to get the page numbers on anything thats not a header/footer. I cant seem to create this table in a header that I know of. Theres the Print Titles feature to print the selected rows every page which works but does not help me with the page numbers. Is there a way for me to get this table at the top of every page and have the page numbers increment?

    excel question.gif

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Header Table Page Numbers

    Here is a user defined function. Add it to a module in a macro-enabled workbook and call it like so:
    =SheetNumber(MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,256))

    Function SheetNumber(SheetName As String) As String
    Dim sh As Worksheet         ' Pointer to sheets
    Dim SheetIndex As Long      ' Index postion of found sheet
    
    Application.Volatile
    'Initalize Variables
    SheetIndex = 1
    
    ' Loop though sheets until you find one of this name
    For Each sh In ActiveWorkbook.Sheets
        If sh.Name = SheetName Then
            Exit For
        End If
        SheetIndex = SheetIndex + 1
    Next
    
    ' Return the string
    SheetNumber = "Page " & SheetIndex & " of " & Sheets.Count
    
    End Function
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ 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. Repeat table header while printing in every page
    By hhh1234 in forum Excel General
    Replies: 0
    Last Post: 11-13-2013, 06:20 AM
  2. Page numbers not in Header/Footer
    By rkemmerich in forum Excel General
    Replies: 2
    Last Post: 04-05-2013, 08:59 AM
  3. How can I select one column from pivot table and use it in the page header ?
    By ie1000100@yahoo.com in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 01-03-2013, 07:10 AM
  4. Replies: 1
    Last Post: 11-10-2010, 11:03 AM
  5. Remove text line after a table OR overlap header/page
    By Banaticus in forum Word Formatting & General
    Replies: 3
    Last Post: 08-04-2009, 06:45 PM
  6. Replies: 0
    Last Post: 06-08-2006, 10:00 AM
  7. [SOLVED] suppressing table header on a page
    By Kevin in forum Excel General
    Replies: 1
    Last Post: 08-08-2005, 05:05 PM
  8. changing page numbers in repeated header
    By Jennifer in forum Excel General
    Replies: 0
    Last Post: 03-02-2005, 02:06 PM

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