Macro to repeat 2 contiguous rows to top of each page

J

jwmbem

I need a macro to repeat rows 23 and 24 at top of each page. I must use page
set up to add rows 3 &4 so can't use it for rows 23 and 24 as well. Please
write macro as I would use it, using rows 23 and rows 24 to repeat at top of
each page.
thank you
 
T

Tom Hutchins

The easiest way is to pull the values from rows 23 & 24 to rows 5 & 6.
A5: =A23 B5: =B23
A6: =A24 B6: =B24 etc.

You can hide these rows until you are ready to print. You can use a simple
macro like the following to unhide rows 5 & 6 and set rows 3:6 as your print
titles.

Sub Macro1()
Rows("5:6").EntireRow.Hidden = False
With ActiveSheet.PageSetup
.PrintTitleRows = "$3:$6"
End With
End Sub

Hope this helps,

Hutch
 
J

jwmbem

Thanks Tom will give it a shot!
--
J Macho


Tom Hutchins said:
The easiest way is to pull the values from rows 23 & 24 to rows 5 & 6.
A5: =A23 B5: =B23
A6: =A24 B6: =B24 etc.

You can hide these rows until you are ready to print. You can use a simple
macro like the following to unhide rows 5 & 6 and set rows 3:6 as your print
titles.

Sub Macro1()
Rows("5:6").EntireRow.Hidden = False
With ActiveSheet.PageSetup
.PrintTitleRows = "$3:$6"
End With
End Sub

Hope this helps,

Hutch
 

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