Using VBA enter cell contents into headers

D

dollinger64

I would like use VBA to insert a range of cells as the header from a
sheet named head. I do not want to use the titles under the print
setup to print the rows above the spreadsheet since the row widths in
the header do not match the rows in the spreadsheet. The header
contains a picture (company logo). Can this be done with VBA or is
there another way to resolve the width issue. I tried this below but
it does not work. It only inserts the A1 cell. Thanks






Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.LeftHeader =
Sheets("head").Range("A1:L15").value
End Sub
 
G

Guest

there arre two ways of gettting rows to repeat on the top of printed sheets.

1) Under View Menu - Headers and footers. This allows only a left, center,
and right header to be inserted into the worksheet and do not allign with the
columns on the sheet.

2) File Menu - Page Setup - Sheet - Rows to repeat at top.
This option alligns with worksheet. Put the items you want in the header in
this section and it will allign with the columns on the worksheet.
 
D

dollinger64

there arre two ways of gettting rows to repeat on the top of printed sheets.

1) Under View Menu - Headers and footers. This allows only a left, center,
and right header to be inserted into the worksheet and do not allign with the
columns on the sheet.

2) File Menu - Page Setup - Sheet - Rows to repeat at top.
This option alligns with worksheet. Put the items you want in the header in
this section and it will allign with the columns on the worksheet.






- Show quoted text -

I do not want to align columns because they are not the same width. If
they were the same width, i would just use the page setup rows ...
 

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