Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default 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
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
printing selection Anniel Excel Discussion (Misc queries) 2 May 28th 10 09:06 PM
printing a filtered selection without blank pages included PhilB Excel Discussion (Misc queries) 0 July 23rd 08 04:38 PM
printing issue - want to repeat two rows and also 5 rows in column cliffykat Excel Discussion (Misc queries) 0 August 29th 07 10:36 PM
Columns are missing when printing a selection syssupspe Excel Discussion (Misc queries) 4 May 29th 07 09:13 PM
Object Type of a selection... counting rows in a selection Acid-Sky[_2_] Excel Programming 3 August 23rd 05 09:53 AM


All times are GMT +1. The time now is 08:49 PM.

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

About Us

"It's about Microsoft Excel"