Inserting Cell Contents into a header

D

Darin Kramer

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!
 
T

Tom Ogilvy

If that is the only information in rows 1 - 3, why not use the rows to
repeat at top setting in page setup.
 
B

Bob Phillips

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)
 
D

Darin Kramer

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top