ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   big question to me (https://www.excelbanter.com/excel-discussion-misc-queries/239437-big-question-me.html)

Wu

big question to me
 
Hello!

I have some product data include invoice no.,part no.,quantity

Shown as below:

Invoice no. | Part no. | Qty.
H0907-001 ERW123 20,000
H0907-001 EAW122 10,000
H0907-002 AWE112 50,000
H0907-003 BPR225 10,000
H0907-003 CRE123 5,000
:
:
:
H0907-XXX XXXXX XX,XXX


I would like to print out these data in seperate page depends on the invoice
no.

For example:

In page 1

H0907-001 ERW123 20,000
H0907-001 EAW122 10,000

In page 2

H0907-002 AWE112 50,000


In page 3

H0907-003 BPR225 10,000
H0907-003 CRE123 5,000


Have any simple methods? Can I just insert a symbol between these invoices?

Jacob Skaria

big question to me
 
You can try out the below macro. If you are new to macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()
--Assume you have the Invoice numbers in ColA starting from row2. and Row1
with headers...The macro will insert pagebreaks after each group of invoice
number. Try print preview once you run the macro and feedback

Sub Pagebreaks()
Dim lngRow As Long
For lngRow = 3 To Cells(Rows.Count, "A").End(xlUp).Row + 1
If Range("A" & lngRow) < Range("A" & lngRow - 1) Then
ActiveSheet.HPageBreaks.Add Befo=Range("A" & lngRow)
End If
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Wu" wrote:

Hello!

I have some product data include invoice no.,part no.,quantity

Shown as below:

Invoice no. | Part no. | Qty.
H0907-001 ERW123 20,000
H0907-001 EAW122 10,000
H0907-002 AWE112 50,000
H0907-003 BPR225 10,000
H0907-003 CRE123 5,000
:
:
:
H0907-XXX XXXXX XX,XXX


I would like to print out these data in seperate page depends on the invoice
no.

For example:

In page 1

H0907-001 ERW123 20,000
H0907-001 EAW122 10,000

In page 2

H0907-002 AWE112 50,000


In page 3

H0907-003 BPR225 10,000
H0907-003 CRE123 5,000


Have any simple methods? Can I just insert a symbol between these invoices?



All times are GMT +1. The time now is 01:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com