Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Using VBA enter cell contents into headers


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

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Using VBA enter cell contents into headers

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.

" wrote:


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


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Using VBA enter cell contents into headers

On Mar 14, 9:02 am, Joel wrote:
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.



" wrote:

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- Hide quoted text -


- 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 ...

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto enter date when data in enter in another cell Brian Excel Worksheet Functions 5 December 7th 06 06:44 PM
How do I enter the contents of a cell into a page header W Mather Excel Discussion (Misc queries) 1 May 15th 06 03:10 PM
Having cell contents enter into cell referenced elbows Excel Discussion (Misc queries) 1 March 10th 06 04:14 PM
Macro to remove contents of cell and move all other contents up one row adw223 Excel Discussion (Misc queries) 1 July 1st 05 03:57 PM
How do I get Excel to automatically enter the contents of a cell . andyb66 Excel Discussion (Misc queries) 1 January 22nd 05 08:04 AM


All times are GMT +1. The time now is 04:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"