Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Aug 15, 1:58 pm, Richard wrote:
This is in the right header only, no cells in the regular worksheet. I am doing this for a document where each time I print the number in the right header has to change without anyone seeing it from the regular worksheet. I would really appreciate the help as I am still learning excel. You could use a macro to do this. I'd save your number in a specific cell in a hidden column. In the example below, I'm saving a number in the cell A1 on Sheet 1 just as an example. The macro adds 1 to the number and then uses that number to modify what is in the Right Hand Header. Sub ModifyHeader() With ActiveSheet.PageSetup Sheet1.Cells(1, 1).Value = Sheet1.Cells(1, 1).Value + 1 .RightHeader = Sheet1.Cells(1, 1).Value End With End Sub Then you can use the BeforePrint event to call the macro. This can be found by going to Tools..Macro..Visual Basic Editor. Use the ThisWorkbook object. Private Sub Workbook_BeforePrint(Cancel As Boolean) Call ModifyHeader End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I get a number to change after each print? | Excel Discussion (Misc queries) | |||
My header and footer show in print preview but don't print. | Excel Discussion (Misc queries) | |||
use a range for a print header | Excel Discussion (Misc queries) | |||
How print header row at top of each page? | Excel Discussion (Misc queries) | |||
Print header | Excel Worksheet Functions |