Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default how to automate page break

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   Report Post  
Posted to microsoft.public.excel.misc
KC KC is offline
external usenet poster
 
Posts: 94
Default how to automate page break

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default how to automate page break

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default how to automate page break

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default how to automate page break

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default how to automate page break

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
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
Vertical page breaks won't drag in Page Break Preview Caroline Excel Discussion (Misc queries) 0 July 14th 09 12:19 PM
How do I do page breaks when view menu doesnt page break preview HeatherF55 Excel Discussion (Misc queries) 0 September 21st 07 04:24 AM
change and/or remove page number watermark in page break preview juga Excel Discussion (Misc queries) 2 December 25th 06 10:15 AM
Hiding the page number in page break preview background. I need coffee, wake me up! Excel Discussion (Misc queries) 0 May 15th 06 10:32 AM
adding a new page break to an existing page break Edward Letendre Excel Discussion (Misc queries) 1 March 6th 05 09:29 AM


All times are GMT +1. The time now is 04:16 AM.

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

About Us

"It's about Microsoft Excel"