ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inserting Cell Contents into a header (https://www.excelbanter.com/excel-programming/318835-inserting-cell-contents-into-header.html)

Darin Kramer

Inserting Cell Contents into a header
 


Hi there,

I want to create a Macro that inserts the contents of six cells, a1 - b3
into a print header....

Any ideas most welcome...

Thanks...

D :)

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Tom Ogilvy

Inserting Cell Contents into a header
 
If that is the only information in rows 1 - 3, why not use the rows to
repeat at top setting in page setup.

--
Regards,
Tom Ogilvy

"Darin Kramer" wrote in message
...


Hi there,

I want to create a Macro that inserts the contents of six cells, a1 - b3
into a print header....

Any ideas most welcome...

Thanks...

D :)

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!




Bob Phillips[_6_]

Inserting Cell Contents into a header
 
Darin,

Here is some code for 2 cells, extend for the rest.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.LeftHeader = .Range("A1") & " - " & .Range("B1")
End With
End Sub

This code should be inserted into the ThisWorkbook code module.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Darin Kramer" wrote in message
...


Hi there,

I want to create a Macro that inserts the contents of six cells, a1 - b3
into a print header....

Any ideas most welcome...

Thanks...

D :)

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!




Darin Kramer

Inserting Cell Contents into a header
 


Good suggestion except that the rows are hidden - and excel, although
allowing you to choose those rows,will not display it when printing. (ie
u can choose the rows to repeat at top, but when Print previewing you
cant see them... cause they hidden) I cant move them to the bottom cause
there is something in row 4 that I need displayed and printed.....

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 12:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com