Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Page break when data changes....

I need to know if it's possible to have a macro (or something automated) to
insert a page break at every change of data in my column A of data. (I've
got about 15,000 rows of data and will probably end up with 9,000 page
breaks.)

I'd like to end up with something like this:

A B C
SORT ACCT SHARES
Apple, Anne 12345 50,000
Apple, Anne 20987 7,000
--------- page break ---------------
Banana, Mike 25678 14,000
Banana, Mike 59873 600
--------- page break --------------
Banana, Karen 25679 34,000

I'm ultimately trying to get the data for each SORT person to print on a
letter template.

Can ya help me out?!

:-)
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Page break when data changes....

You could use
Data|subtotals
and choose to insert a page break between groups.

And you'll be able to subtotal the shares, too.

And you'll be able to use the outlining symbols to the left to hide/show
details.

tfarley wrote:

I need to know if it's possible to have a macro (or something automated) to
insert a page break at every change of data in my column A of data. (I've
got about 15,000 rows of data and will probably end up with 9,000 page
breaks.)

I'd like to end up with something like this:

A B C
SORT ACCT SHARES
Apple, Anne 12345 50,000
Apple, Anne 20987 7,000
--------- page break ---------------
Banana, Mike 25678 14,000
Banana, Mike 59873 600
--------- page break --------------
Banana, Karen 25679 34,000

I'm ultimately trying to get the data for each SORT person to print on a
letter template.

Can ya help me out?!

:-)


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Page break when data changes....

Thank you for your reply! I did try that and the reason it didn't work is
because apparently there is a limit on the number of page breaks that a
subtotal can enter into a worksheet and I exceed that number.

"Dave Peterson" wrote:

You could use
Data|subtotals
and choose to insert a page break between groups.

And you'll be able to subtotal the shares, too.

And you'll be able to use the outlining symbols to the left to hide/show
details.

tfarley wrote:

I need to know if it's possible to have a macro (or something automated) to
insert a page break at every change of data in my column A of data. (I've
got about 15,000 rows of data and will probably end up with 9,000 page
breaks.)

I'd like to end up with something like this:

A B C
SORT ACCT SHARES
Apple, Anne 12345 50,000
Apple, Anne 20987 7,000
--------- page break ---------------
Banana, Mike 25678 14,000
Banana, Mike 59873 600
--------- page break --------------
Banana, Karen 25679 34,000

I'm ultimately trying to get the data for each SORT person to print on a
letter template.

Can ya help me out?!

:-)


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Page break when data changes....

With fruits in Column A, and Names in Column B, etc.:

Sub Insert_PBreak()
Dim OldVal As String
Dim rng As Range

lastrow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
For row_index = lastrow - 1 To 1 Step -1
If Cells(row_index, "B").Value < _
Cells(row_index + 1, "B").Value Then
ActiveSheet.HPageBreaks.Add Befo= _
Cells(row_index + 1, "B")
End If
Next

End Sub


Regards,
Ryan---

--
RyGuy


"tfarley" wrote:

Thank you for your reply! I did try that and the reason it didn't work is
because apparently there is a limit on the number of page breaks that a
subtotal can enter into a worksheet and I exceed that number.

"Dave Peterson" wrote:

You could use
Data|subtotals
and choose to insert a page break between groups.

And you'll be able to subtotal the shares, too.

And you'll be able to use the outlining symbols to the left to hide/show
details.

tfarley wrote:

I need to know if it's possible to have a macro (or something automated) to
insert a page break at every change of data in my column A of data. (I've
got about 15,000 rows of data and will probably end up with 9,000 page
breaks.)

I'd like to end up with something like this:

A B C
SORT ACCT SHARES
Apple, Anne 12345 50,000
Apple, Anne 20987 7,000
--------- page break ---------------
Banana, Mike 25678 14,000
Banana, Mike 59873 600
--------- page break --------------
Banana, Karen 25679 34,000

I'm ultimately trying to get the data for each SORT person to print on a
letter template.

Can ya help me out?!

:-)


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Page break when data changes....

Okay.... I don't understand what you just wrote. Anyway you can translate
that into leyman terms?!? (I'm sorry....I feel bad, but I'm not a expert
user.....)

Thank you!!

"ryguy7272" wrote:

With fruits in Column A, and Names in Column B, etc.:

Sub Insert_PBreak()
Dim OldVal As String
Dim rng As Range

lastrow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
For row_index = lastrow - 1 To 1 Step -1
If Cells(row_index, "B").Value < _
Cells(row_index + 1, "B").Value Then
ActiveSheet.HPageBreaks.Add Befo= _
Cells(row_index + 1, "B")
End If
Next

End Sub


Regards,
Ryan---

--
RyGuy


"tfarley" wrote:

Thank you for your reply! I did try that and the reason it didn't work is
because apparently there is a limit on the number of page breaks that a
subtotal can enter into a worksheet and I exceed that number.

"Dave Peterson" wrote:

You could use
Data|subtotals
and choose to insert a page break between groups.

And you'll be able to subtotal the shares, too.

And you'll be able to use the outlining symbols to the left to hide/show
details.

tfarley wrote:

I need to know if it's possible to have a macro (or something automated) to
insert a page break at every change of data in my column A of data. (I've
got about 15,000 rows of data and will probably end up with 9,000 page
breaks.)

I'd like to end up with something like this:

A B C
SORT ACCT SHARES
Apple, Anne 12345 50,000
Apple, Anne 20987 7,000
--------- page break ---------------
Banana, Mike 25678 14,000
Banana, Mike 59873 600
--------- page break --------------
Banana, Karen 25679 34,000

I'm ultimately trying to get the data for each SORT person to print on a
letter template.

Can ya help me out?!

:-)

--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Page break when data changes....

You're right. I think that the number of page breaks is a little over a 1000.
(I think!)

I think you're going to have to rethink your problem.



tfarley wrote:

Thank you for your reply! I did try that and the reason it didn't work is
because apparently there is a limit on the number of page breaks that a
subtotal can enter into a worksheet and I exceed that number.

"Dave Peterson" wrote:

You could use
Data|subtotals
and choose to insert a page break between groups.

And you'll be able to subtotal the shares, too.

And you'll be able to use the outlining symbols to the left to hide/show
details.

tfarley wrote:

I need to know if it's possible to have a macro (or something automated) to
insert a page break at every change of data in my column A of data. (I've
got about 15,000 rows of data and will probably end up with 9,000 page
breaks.)

I'd like to end up with something like this:

A B C
SORT ACCT SHARES
Apple, Anne 12345 50,000
Apple, Anne 20987 7,000
--------- page break ---------------
Banana, Mike 25678 14,000
Banana, Mike 59873 600
--------- page break --------------
Banana, Karen 25679 34,000

I'm ultimately trying to get the data for each SORT person to print on a
letter template.

Can ya help me out?!

:-)


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Page break when data changes....

Read this:
http://www.anthony-vba.kefra.com/vba...ur_First_Macro

Copy and paste the macro that I gave you into a module.
Run the code in the module.

Regards,
Ryan---


--
RyGuy


"Dave Peterson" wrote:

You're right. I think that the number of page breaks is a little over a 1000.
(I think!)

I think you're going to have to rethink your problem.



tfarley wrote:

Thank you for your reply! I did try that and the reason it didn't work is
because apparently there is a limit on the number of page breaks that a
subtotal can enter into a worksheet and I exceed that number.

"Dave Peterson" wrote:

You could use
Data|subtotals
and choose to insert a page break between groups.

And you'll be able to subtotal the shares, too.

And you'll be able to use the outlining symbols to the left to hide/show
details.

tfarley wrote:

I need to know if it's possible to have a macro (or something automated) to
insert a page break at every change of data in my column A of data. (I've
got about 15,000 rows of data and will probably end up with 9,000 page
breaks.)

I'd like to end up with something like this:

A B C
SORT ACCT SHARES
Apple, Anne 12345 50,000
Apple, Anne 20987 7,000
--------- page break ---------------
Banana, Mike 25678 14,000
Banana, Mike 59873 600
--------- page break --------------
Banana, Karen 25679 34,000

I'm ultimately trying to get the data for each SORT person to print on a
letter template.

Can ya help me out?!

:-)

--

Dave Peterson


--

Dave Peterson

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Page break when data changes....

Thank you!

I did that.....and I get the same type error, saying that I can only have
1026 pagebreaks per worksheet.

So, now I think my next step should just be do split my data into Alpha
files (A, B, C, etc) and run that script for each smaller file and then I
should be golden!

Thank you Thank you Thank you!

"ryguy7272" wrote:

Read this:
http://www.anthony-vba.kefra.com/vba...ur_First_Macro

Copy and paste the macro that I gave you into a module.
Run the code in the module.

Regards,
Ryan---


--
RyGuy


"Dave Peterson" wrote:

You're right. I think that the number of page breaks is a little over a 1000.
(I think!)

I think you're going to have to rethink your problem.



tfarley wrote:

Thank you for your reply! I did try that and the reason it didn't work is
because apparently there is a limit on the number of page breaks that a
subtotal can enter into a worksheet and I exceed that number.

"Dave Peterson" wrote:

You could use
Data|subtotals
and choose to insert a page break between groups.

And you'll be able to subtotal the shares, too.

And you'll be able to use the outlining symbols to the left to hide/show
details.

tfarley wrote:

I need to know if it's possible to have a macro (or something automated) to
insert a page break at every change of data in my column A of data. (I've
got about 15,000 rows of data and will probably end up with 9,000 page
breaks.)

I'd like to end up with something like this:

A B C
SORT ACCT SHARES
Apple, Anne 12345 50,000
Apple, Anne 20987 7,000
--------- page break ---------------
Banana, Mike 25678 14,000
Banana, Mike 59873 600
--------- page break --------------
Banana, Karen 25679 34,000

I'm ultimately trying to get the data for each SORT person to print on a
letter template.

Can ya help me out?!

:-)

--

Dave Peterson


--

Dave Peterson

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
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
adding a new page break to an existing page break Edward Letendre Excel Discussion (Misc queries) 1 March 6th 05 09:29 AM
data before page break lost during import javajoy Excel Discussion (Misc queries) 0 February 24th 05 09:13 PM
Is there a way to get an auto page break as data changes in Excel. george_visalia Excel Discussion (Misc queries) 2 December 16th 04 12:22 AM


All times are GMT +1. The time now is 11:54 PM.

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"