Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
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?

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
How to display current page number in any cell of that page. Laljeet Excel Discussion (Misc queries) 8 February 2nd 08 01:31 AM
adding number only if CDN is displayed in next cell ED New Users to Excel 2 December 21st 05 10:39 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
Can I remove the "page and number" displayed on Excel spreadsheet Janice Jackson Excel Discussion (Misc queries) 1 August 17th 05 06:06 PM
Count number of times a specific number is displayed in a cell ran subs Excel Worksheet Functions 1 June 27th 05 05:01 PM


All times are GMT +1. The time now is 02:23 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"