Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Page numbers in a CELL

Hi,

This is a rare occasion where i want to add page numbers to a specific cell.
i do NOT want to make use of footers/headers etc. how can i create a function
or any way to have a cell with Page x of y etc.

please help....
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Page numbers in a CELL

Whcih page ??

Because columns and rows can be repeated in all printed pages, a single cell
can reside on all printed pages.


I.A.C. see:

http://groups.google.com/group/micro...8cc5de0bca86f4

--
Gary's Student


"pjerling" wrote:

Hi,

This is a rare occasion where i want to add page numbers to a specific cell.
i do NOT want to make use of footers/headers etc. how can i create a function
or any way to have a cell with Page x of y etc.

please help....

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 718
Default Page numbers in a CELL

Here's a function that returns page number depending on pagebreaks ans page
steup order

Cheers,
--
AP

:
'------------------------------------------------------------------
Function pageNo() As String
Dim rCurr As Range
Dim lHoriz As Long
Dim lVert As Long
Dim lPage As Long
Application.Volatile True
Set rCurr = Application.Caller ' Caller's address
With ActiveSheet
'Evaluate Horizontal page breaks
lHoriz = 1
Do While lHoriz <= .HPageBreaks.Count
If rCurr.Row = .HPageBreaks(lHoriz).Location.Row Then
lHoriz = lHoriz + 1
Else
Exit Do
End If
Loop
'Evaluate Vertical page breaks
lVert = 1
Do While lVert <= .VPageBreaks.Count
If rCurr.Column = .VPageBreaks(lVert).Location.Column Then
lVert = lVert + 1
Else
Exit Do
End If
Loop
' Evaluate page # depending on page order
If .PageSetup.Order = xlDownThenOver Then
lPage = lHoriz + (.HPageBreaks.Count + 1) * (lVert - 1)
Else
lPage = lVert + (.VPageBreaks.Count + 1) * (lHoriz - 1)
End If
' Return result
pageNo = lPage & " of " & (.HPageBreaks.Count + 1) *
(.VPageBreaks.Count + 1)
End With
End Function
'----------------------------------------------------------------------------

"pjerling" a écrit dans le message de
news: ...
Hi,

This is a rare occasion where i want to add page numbers to a specific
cell.
i do NOT want to make use of footers/headers etc. how can i create a
function
or any way to have a cell with Page x of y etc.

please help....



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
New numbers Larry Excel Worksheet Functions 7 August 31st 06 04:54 PM
how in excel, return page numbers in to cell ?(like date function selva Excel Discussion (Misc queries) 4 August 16th 06 10:26 AM
Mileage Claim Formula johndavies New Users to Excel 4 August 14th 06 09:24 AM
Inserting page numbers in a cell DannyG Excel Discussion (Misc queries) 2 July 19th 05 12:37 AM
Paste rows of numbers from Word into single Excel cell BecG Excel Discussion (Misc queries) 1 December 8th 04 04:55 PM


All times are GMT +1. The time now is 07:39 AM.

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

About Us

"It's about Microsoft Excel"