Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 62
Default Macro to determine row of page break on modified presentation sheet?

I have a presentation sheet where the first five rows or so can be
changed, etc., to account for different information etc. - i.e. the
header of the sheet.

After the sheet header is data information contained in rows of all
the same height.

The problem is that depending one how these first five rows looks
(i.e. sometimes it's only 3 rows and thin, or sometimes all 5 and
fat), the page break occurs on different rows.

In my macro, when the user inputs information, if it goes past the
page break, I'd like a new sheet to be made, and the information to
start being displayed on that new sheet.

Right now I have a manual page break input question (i.e. macro asks
in the beginning please input the last row on the sheet before the
page break). Is there a way I can make the macro do this
automatically? I.E. detect where the page break is and identify the
row number of the last row before the page break?

Thanks, an odd question, I'll start with a dummy worksheet and macro
to try and figure this out....

-np
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Macro to determine row of page break on modified presentation shee

hi
read up on the HPageBreak and VPageBreak properties in vb help.
also see this site.
http://www.ozgrid.com/forum/showthread.php?t=73446

example
Dim pb As Variant
Dim r As Range
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
For Each pb In ws.HPageBreaks
Set r = ws.Range("A" & pb.Location.Row)
MsgBox r.Address
Next pb

regards
FSt1

"pallaver" wrote:

I have a presentation sheet where the first five rows or so can be
changed, etc., to account for different information etc. - i.e. the
header of the sheet.

After the sheet header is data information contained in rows of all
the same height.

The problem is that depending one how these first five rows looks
(i.e. sometimes it's only 3 rows and thin, or sometimes all 5 and
fat), the page break occurs on different rows.

In my macro, when the user inputs information, if it goes past the
page break, I'd like a new sheet to be made, and the information to
start being displayed on that new sheet.

Right now I have a manual page break input question (i.e. macro asks
in the beginning please input the last row on the sheet before the
page break). Is there a way I can make the macro do this
automatically? I.E. detect where the page break is and identify the
row number of the last row before the page break?

Thanks, an odd question, I'll start with a dummy worksheet and macro
to try and figure this out....

-np

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 62
Default Macro to determine row of page break on modified presentationshee

Thanks, perfect.
pb.Location.Row - 1 is exactly the variable I was looking for.

On 7$B7n(B21$BF|(B, $B8aA0(B11:17, FSt1 wrote:
hi
read up on the HPageBreak and VPageBreak properties in vb help.
also see this site.http://www.ozgrid.com/forum/showthread.php?t=73446

example
Dim pb As Variant
Dim r As Range
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
For Each pb In ws.HPageBreaks
Set r = ws.Range("A" & pb.Location.Row)
MsgBox r.Address
Next pb

regards
FSt1



"pallaver" wrote:
I have a presentation sheet where the first five rows or so can be
changed, etc., to account for different information etc. - i.e. the
header of the sheet.


After the sheet header is data information contained in rows of all
the same height.


The problem is that depending one how these first five rows looks
(i.e. sometimes it's only 3 rows and thin, or sometimes all 5 and
fat), the page break occurs on different rows.


In my macro, when the user inputs information, if it goes past the
page break, I'd like a new sheet to be made, and the information to
start being displayed on that new sheet.


Right now I have a manual page break input question (i.e. macro asks
in the beginning please input the last row on the sheet before the
page break). Is there a way I can make the macro do this
automatically? I.E. detect where the page break is and identify the
row number of the last row before the page break?


Thanks, an odd question, I'll start with a dummy worksheet and macro
to try and figure this out....


-np- $B0zMQ%F%-%9%H$rI=<($7$J$$(B -


- $B0zMQ%F%-%9%H$rI=<((B -


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
excel macro page break KC Rippstein hotmail com> Excel Discussion (Misc queries) 1 March 16th 07 06:37 PM
adding a new page break to an existing page break Edward Letendre Excel Discussion (Misc queries) 1 March 6th 05 09:29 AM
How do you set up a data excel sheet that links to a presentation. Moxy247 Excel Worksheet Functions 0 January 31st 05 06:18 PM
Using macro for page break Sara Excel Discussion (Misc queries) 2 January 13th 05 09:29 PM
Page break macro lehigh46 Excel Worksheet Functions 2 November 17th 04 02:00 AM


All times are GMT +1. The time now is 02:58 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"