Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Add a cell reference to a page footer | Excel Discussion (Misc queries) | |||
How to display current page number in any cell of that page. | Excel Discussion (Misc queries) | |||
How can i print 1 page many times with diferent reference number ? | Excel Discussion (Misc queries) | |||
Data in cell to reference a worksheet page | Excel Worksheet Functions | |||
sheet tabs as page number and in a cell page of pages? | Excel Discussion (Misc queries) |