how to automate page break

  • Thread starter Thread starter goodman
  • Start date Start date
G

goodman

I have a sheet for different customers name with total foe each.I want to
print every customer seperate by inserting a page break at the total line. I
did it before manualy
Is any way I can do it automaicaly or with a macro

Your help is greatly appreciated
 
goto 'View' menu and click 'Page Break Preview'

once your in page break preview mode, you can right click on the row where
you what to insert the pagebreak and select 'Insert Page Break'

-kc
*Click YES if this helps
 
Sub Insert_PBreak_Col()
Dim rng As Range
Dim Cell As Range
Set rng = Intersect(ActiveSheet.UsedRange, Columns(4)) 'adjust to suit
For Each Cell In rng
If Cell.text = "Total" Then
Cell.Offset(1, 1).PageBreak = xlPageBreakManual

End If
Next

End Sub


Gord Dibben MS Excel MVP
 
thanks a lot but you didn't show me how to execute this subroutine, I
appreciate it if you give me some instruction, for example what is the
columns(4) is this where the word Total exixt ?

please help with some detail

thanks again Gord
 
When you asked for a macro I assumed you knew what to do with one.

Columns(4) is Column D and a pagebreak will be inserted below each instance
of the word "Total" in that column.

You have to adjust the column to suit your layout.


Gord
 
Back
Top