Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Printing a selection of rows
Thanks for the quick help last time. I have data in rows by a Rep name. Some Reps have one row some reps have 4 rows. I would like to print a single page for each with the data that belongs to them. Such as if a Rep only has one row only one prints out if another Rep has three then all three print on the same sheet. Any thoughts? thanks, jason -- Jbucks007 ------------------------------------------------------------------------ Jbucks007's Profile: http://www.excelforum.com/member.php...o&userid=28661 View this thread: http://www.excelforum.com/showthread...hreadid=486051 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Printing a selection of rows
The following reads the column A and if the contents changes from the
previous row a horizontal page break is inserted....... Note: You might want to sort the data before this run to ensure each set of data are together. Also Excel has a limit of 1026 HPageBreaks per sheet. Sub PagesBrk() Dim xlr As Long, xr As Long xlr = Cells(Rows.Count, 1).End(xlUp).Row For xr = 2 To xlr If Cells(xr, 1) < Cells(xr - 1, 1) Then ActiveWindow.SelectedSheets.HPageBreaks.Add Befo=Rows(xr) End If Next xr End Sub -- Cheers Nigel "Jbucks007" wrote in message ... Thanks for the quick help last time. I have data in rows by a Rep name. Some Reps have one row some reps have 4 rows. I would like to print a single page for each with the data that belongs to them. Such as if a Rep only has one row only one prints out if another Rep has three then all three print on the same sheet. Any thoughts? thanks, jason -- Jbucks007 ------------------------------------------------------------------------ Jbucks007's Profile: http://www.excelforum.com/member.php...o&userid=28661 View this thread: http://www.excelforum.com/showthread...hreadid=486051 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
printing selection | Excel Discussion (Misc queries) | |||
printing a filtered selection without blank pages included | Excel Discussion (Misc queries) | |||
printing issue - want to repeat two rows and also 5 rows in column | Excel Discussion (Misc queries) | |||
Columns are missing when printing a selection | Excel Discussion (Misc queries) | |||
Object Type of a selection... counting rows in a selection | Excel Programming |