Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Repeat Multiple Page Headers using VBA

Is there a way to print multiple row headers? For example, I have a
the following:

A B C
1 2 3
3 2 1

D E F
1 2 3
3 2 1

I want to repeat cols A:C for the first data range when it spills over
to page 2. Cols D:F is the next data range on page 2, which spills
over to page 3. I now want D:F to be the headers. So in summary, I
want page 1-2 to have A:C header and at the same time on page 2-3 have
D:F. I hope this makes sense and that this it is possible.

I have used this code, but it only works for 1 continuous range.
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$1"
End With

It would be nice to have something like this, but it doesn't work:
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleRows = "$20:$20"
.PrintTitleRows = "$40:$40"
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Repeat Multiple Page Headers using VBA

You would have to print each section separately and reset the rows to repeat
at top prior to printing.

--
Regards,
Tom Ogilvy

"CST" wrote in message
om...
Is there a way to print multiple row headers? For example, I have a
the following:

A B C
1 2 3
3 2 1

D E F
1 2 3
3 2 1

I want to repeat cols A:C for the first data range when it spills over
to page 2. Cols D:F is the next data range on page 2, which spills
over to page 3. I now want D:F to be the headers. So in summary, I
want page 1-2 to have A:C header and at the same time on page 2-3 have
D:F. I hope this makes sense and that this it is possible.

I have used this code, but it only works for 1 continuous range.
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$1"
End With

It would be nice to have something like this, but it doesn't work:
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleRows = "$20:$20"
.PrintTitleRows = "$40:$40"
.
.
.
. etc.....
End With

TIA



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Repeat Multiple Page Headers using VBA

Thank you for the response. Unfortunately, we have to have these
sections continuous. I pretty much thought that there wasn't a way, but
wanted to throw the question out anyways. Any other suggestions? TIA!



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Repeat Multiple Page Headers using VBA

Move your sections to separate sheets, define the rows to repeat at top for
each, group the sheets and print.

--
Regards,
Tom Ogilvy

"Con Tang" wrote in message
...
Thank you for the response. Unfortunately, we have to have these
sections continuous. I pretty much thought that there wasn't a way, but
wanted to throw the question out anyways. Any other suggestions? TIA!



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



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
repeat first row at the top of page? dumo13 New Users to Excel 5 November 16th 08 01:14 AM
Repeat headers only when data existss jhouse Excel Discussion (Misc queries) 1 February 7th 08 11:16 PM
Printing Headers on only first page and Footers on only last page JacMar Excel Discussion (Misc queries) 5 January 21st 07 03:48 PM
How to repeat multiple rows as a header - each page of worksheet? laurandc Excel Worksheet Functions 1 August 17th 06 03:03 PM
How do I make the custom headers and footer repeat on every works. Chrisod Excel Worksheet Functions 3 January 24th 05 09:05 AM


All times are GMT +1. The time now is 01:33 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"