Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cell Value in Header / Not Using VBA | New Users to Excel | |||
Header as cell value | Excel Discussion (Misc queries) | |||
Populating Last Saved Date in Cell AND also update that same cell in Header | Excel Discussion (Misc queries) | |||
Excel-Header-My Company Name won't work in Header (AT&T) & Time | Excel Discussion (Misc queries) | |||
Excel: want header cell sizes to differ from the other sheet cell. | Excel Discussion (Misc queries) |