Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cell in Header ?


I have been given a worksheet to print that will consist of 300 a4
pages.

What I would like to do is take the value of 2 cells from each page and
print them in the header for that page. This will allow a simple
indexing system without having to examine each page.

The pages are identical in layout and the same 2 cells will be used
from each page.

I have tried the standard 'cell in header' but that would print the
same info on every page. Is there a way to do this automatically?

I have never done macros in excel so all help will be appreciated.

Thanks

Ron.


--
Ronbmy
------------------------------------------------------------------------
Ronbmy's Profile: http://www.excelforum.com/member.php...o&userid=24164
View this thread: http://www.excelforum.com/showthread...hreadid=379477

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Cell in Header ?

Hi

Untested (No printer om my machine on this moment)

Try this example for pages below each other
Let me know if t is working correct

It will print the cell in A and C from the first row in each page in
the header.

Sub Test_For_Each_HPageBreak()
Dim HPB As HPageBreak
Dim RW As Long
Dim PageNum As Long
Dim Asheet As Worksheet

Set Asheet = ActiveSheet
RW = 1
PageNum = 1

If Asheet.HPageBreaks.Count = 0 Then
MsgBox "There are no HPageBreaks"
Exit Sub
End If

For Each HPB In Asheet.HPageBreaks

With Asheet.PageSetup
.RightHeader = Asheet.Cells(RW, "A") & " " & Asheet.Cells(RW, "C")
ActiveSheet.PrintOut From:=PageNum, To:=PageNum
End With

RW = HPB.Location.Row
PageNum = PageNum + 1
Next HPB

Asheet.DisplayPageBreaks = False
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ronbmy" wrote in message
...

I have been given a worksheet to print that will consist of 300 a4
pages.

What I would like to do is take the value of 2 cells from each page and
print them in the header for that page. This will allow a simple
indexing system without having to examine each page.

The pages are identical in layout and the same 2 cells will be used
from each page.

I have tried the standard 'cell in header' but that would print the
same info on every page. Is there a way to do this automatically?

I have never done macros in excel so all help will be appreciated.

Thanks

Ron.


--
Ronbmy
------------------------------------------------------------------------
Ronbmy's Profile: http://www.excelforum.com/member.php...o&userid=24164
View this thread: http://www.excelforum.com/showthread...hreadid=379477



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cell in Header ?


Hi Ron,

Many thanks for that - it works perfectly.

Ron.


--
Ronbmy
------------------------------------------------------------------------
Ronbmy's Profile: http://www.excelforum.com/member.php...o&userid=24164
View this thread: http://www.excelforum.com/showthread...hreadid=379477

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Cell in Header ?

Thanks for the feedback


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ronbmy" wrote in message
...

Hi Ron,

Many thanks for that - it works perfectly.

Ron.


--
Ronbmy
------------------------------------------------------------------------
Ronbmy's Profile: http://www.excelforum.com/member.php...o&userid=24164
View this thread: http://www.excelforum.com/showthread...hreadid=379477



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
Cell Value in Header / Not Using VBA Gojavid New Users to Excel 7 April 23rd 23 07:44 PM
Header as cell value michaelberrier Excel Discussion (Misc queries) 3 May 31st 07 11:24 PM
Populating Last Saved Date in Cell AND also update that same cell in Header o0o_Bigs_o0o Excel Discussion (Misc queries) 2 July 4th 06 12:56 PM
Excel-Header-My Company Name won't work in Header (AT&T) & Time June K Excel Discussion (Misc queries) 2 April 10th 06 08:36 PM
Excel: want header cell sizes to differ from the other sheet cell. mayrl Excel Discussion (Misc queries) 0 January 18th 06 06:41 PM


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