Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Page number reference in a cell

Is there a way to reference the page number of a page in the middle of a
document and input it into a cell. The problem is that as information is
added or deleted the page will move so I am trying to write something to
reference what that page number will be when it is printed.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Page number reference in a cell

Found a way

Dim ws As Worksheet
Dim lngPageNumber As Long
Dim hPgBrks As Long

lngPageNumber = 0

For Each ws In ActiveWindow.SelectedSheets
hPgBrks = 0
If ws.HPageBreaks.Count = 0 Then
hPgBrks = 1
Else
hPgBrks = ws.HPageBreaks.Count + 1
End If
lngPageNumber = lngPageNumber + hPgBrks
ws.Range("Z1").Value = lngPageNumber
Next ws
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add a cell reference to a page footer scheduling Excel Discussion (Misc queries) 1 August 12th 08 10:42 PM
How to display current page number in any cell of that page. Laljeet Excel Discussion (Misc queries) 8 February 2nd 08 01:31 AM
How can i print 1 page many times with diferent reference number ? Sixto Valenzuela Excel Discussion (Misc queries) 2 December 16th 05 03:58 PM
Data in cell to reference a worksheet page David Billigmeier Excel Worksheet Functions 2 December 15th 05 10:52 PM
sheet tabs as page number and in a cell page of pages? [email protected] Excel Discussion (Misc queries) 0 November 22nd 05 02:43 PM


All times are GMT +1. The time now is 10:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"