A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Can a page number be displayed in a cell?



 
 
Thread Tools Display Modes
  #1  
Old July 30th, 2008, 07:31 PM posted to microsoft.public.excel.worksheet.functions
jdwyer
external usenet poster
 
Posts: 1
Default Can a page number be displayed in a cell?

I am trying to lookup a value in a different sheet, and insead of having
excel return specific values within that sheet, I would like for it to return
the Footer value. Is this possible?
  #2  
Old August 3rd, 2008, 02:55 PM posted to microsoft.public.excel.worksheet.functions
ryguy7272
external usenet poster
 
Posts: 1,593
Default Can a page number be displayed in a cell?

Yes, you can do this. You just need a little VBA code:
Sub HeaderFooterSummary()
Dim ws As Worksheet, l As Long, PSinfo(1 To 7) As String

Application.ScreenUpdating = False
'prevent screen flicker during processing
With Sheet1
'amend sheet as required or add a new one if needed
l = 1
'the row counter
.Cells(l, 1).Value = "Sheet Name"
.Cells(l, 2).Value = "Left Header"
.Cells(l, 3).Value = "Centre Header"
.Cells(l, 4).Value = "Right Header"
.Cells(l, 5).Value = "Left Footer"
.Cells(l, 6).Value = "Centre Footer"
.Cells(l, 7).Value = "Right Footer"
'the headings
For Each ws In Worksheets
l = l + 1
With ws
PSinfo(1) = .Name
'the sheet name
With .PageSetup
PSinfo(2) = .LeftHeader
PSinfo(3) = .CenterHeader
PSinfo(4) = .RightHeader
PSinfo(5) = .LeftFooter
PSinfo(6) = .CenterFooter
PSinfo(7) = .RightFooter
End With
'the pagesetup info
End With
.Range(.Cells(l, 1), .Cells(l, 7)).Value = PSinfo
'pass array info to range on summary sheet
Next
.Columns("A:G").AutoFit
'resize columns as needed
End With
Application.ScreenUpdating = True

End Sub

If you don't know much about VBA, or know nothing about it, take a look at
this:
http://www.anthony-vba.kefra.com/vba...ur_First_Macro

Regards,
Ryan---


--
RyGuy


"jdwyer" wrote:

I am trying to lookup a value in a different sheet, and insead of having
excel return specific values within that sheet, I would like for it to return
the Footer value. Is this possible?

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


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