ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Header using cell data (https://www.excelbanter.com/excel-programming/354691-header-using-cell-data.html)

Wayne

Header using cell data
 
I'm trying to create a header that will pull in data from a mergerd cells
which are typically located in mergers cells C4-G4, C5-G5, etc.

I want the header to appear as:-

" Project" & Ative sheet cel C4-G4
" Address" & Active sheet cell C5-G5.....

I've established from previous posts that the code should go in the workbook
before print event but not really got any further....

Any ideas?

Nigel

Header using cell data
 
This will do it ...

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.LeftHeader = _
"Project: " & ActiveSheet.Range("C4") & Chr(10) & _
"Address: " & ActiveSheet.Range("C5")
End Sub

--
Cheers
Nigel



"Wayne" wrote in message
...
I'm trying to create a header that will pull in data from a mergerd cells
which are typically located in mergers cells C4-G4, C5-G5, etc.

I want the header to appear as:-

" Project" & Ative sheet cel C4-G4
" Address" & Active sheet cell C5-G5.....

I've established from previous posts that the code should go in the

workbook
before print event but not really got any further....

Any ideas?





All times are GMT +1. The time now is 05:22 PM.

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