Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 "goodman" wrote: 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 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 On Thu, 17 Sep 2009 20:34:01 -0700, goodman wrote: 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 |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 "Gord Dibben" wrote: 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 On Thu, 17 Sep 2009 20:34:01 -0700, goodman wrote: 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 |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Columns(4) is the fourth column in the worksheet (Column D).
If you're new to macros: Debra Dalgleish has some notes how to implement macros he http://www.contextures.com/xlvba01.html David McRitchie has an intro to macros: http://www.mvps.org/dmcritchie/excel/getstarted.htm Ron de Bruin's intro to macros: http://www.rondebruin.nl/code.htm (General, Regular and Standard modules all describe the same thing.) goodman wrote: 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 "Gord Dibben" wrote: 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 On Thu, 17 Sep 2009 20:34:01 -0700, goodman wrote: 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 -- Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 On Fri, 18 Sep 2009 20:49:01 -0700, goodman wrote: 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 "Gord Dibben" wrote: 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 On Thu, 17 Sep 2009 20:34:01 -0700, goodman wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Vertical page breaks won't drag in Page Break Preview | Excel Discussion (Misc queries) | |||
How do I do page breaks when view menu doesnt page break preview | Excel Discussion (Misc queries) | |||
change and/or remove page number watermark in page break preview | Excel Discussion (Misc queries) | |||
Hiding the page number in page break preview background. | Excel Discussion (Misc queries) | |||
adding a new page break to an existing page break | Excel Discussion (Misc queries) |