Macro to setup Rows to Repeat at the Top

S

Steven

I would like to create a macro to setup Rows to Repeat at the Top based on
the current rows selected. ie I would just select the rows and I plan on
using a menu bar macro button to run the macro. Therefore the macro needs to
know to use the currently selected rows to use as the rows to repeat at the
top.

I tried something like:

With ActiveSheet.PageSetup
.PrintTitleRows = Selection.Rows
End With

but thats not it. It returns an error.

Thank you for your help,


Steven
 
S

Steven

That is not what I am looking for. That works if I want row 1 and 2. But I
want to go with the current selection top row and bottom row because it will
not always be row 1 and 2 that I want to repeat. I want to use the current
rows selected.

Thanks,

Steven
 
J

JP

Who are you talking to?

Mine works no matter how many rows you select.

With ActiveSheet.PageSetup
.PrintTitleRows = Selection.Areas(1).Address
End With


--JP
 

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