Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default Anyway to detect a new page

Hello I'd like someway to figure out if my loop ends up on a new page, and I
was wondering if there was a check to see if something is on a different page?

For example I was thinking of something along the lines:
dim pageAt as Integer
pageAt = Sheet1.Cells(10, 1).Row.PageOn

for i = 10 to 200
if Sheet1.Cells(i, 1).Row.PageOn < pageAt then
MsgBox("New Page")
pageAt = Sheet1.Cells(i, 1).Row.PageOn
end if

I know there is no PageOn method/property etc but is there anything like
that?
Thanks for anyone who can throw some advice my way.

Nate
next i
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Anyway to detect a new page


found = false
for i = 10 to 200
if Sheet1.Cells(i, 1).Row.PageOn < pageAt then
MsgBox("New Page")
pageAt = Sheet1.Cells(i, 1).Row.PageOn
Found = true
exit for
end if
next i
if found = true then
MsgBox("added new Page")
end if

"NateBuckley" wrote:

Hello I'd like someway to figure out if my loop ends up on a new page, and I
was wondering if there was a check to see if something is on a different page?

For example I was thinking of something along the lines:
dim pageAt as Integer
pageAt = Sheet1.Cells(10, 1).Row.PageOn

for i = 10 to 200
if Sheet1.Cells(i, 1).Row.PageOn < pageAt then
MsgBox("New Page")
pageAt = Sheet1.Cells(i, 1).Row.PageOn
end if

I know there is no PageOn method/property etc but is there anything like
that?
Thanks for anyone who can throw some advice my way.

Nate
next i

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default Anyway to detect a new page

Sorry I may have not been clear, but i mentioned there is no "PageOn"
property of Row, the code I posted was just an example of something I'd like
to do.

I was just wondering if anyone knew of a property that is like the made up
PageOn that I simply can't find.

Thanks for your post though.

"Joel" wrote:


found = false
for i = 10 to 200
if Sheet1.Cells(i, 1).Row.PageOn < pageAt then
MsgBox("New Page")
pageAt = Sheet1.Cells(i, 1).Row.PageOn
Found = true
exit for
end if
next i
if found = true then
MsgBox("added new Page")
end if

"NateBuckley" wrote:

Hello I'd like someway to figure out if my loop ends up on a new page, and I
was wondering if there was a check to see if something is on a different page?

For example I was thinking of something along the lines:
dim pageAt as Integer
pageAt = Sheet1.Cells(10, 1).Row.PageOn

for i = 10 to 200
if Sheet1.Cells(i, 1).Row.PageOn < pageAt then
MsgBox("New Page")
pageAt = Sheet1.Cells(i, 1).Row.PageOn
end if

I know there is no PageOn method/property etc but is there anything like
that?
Thanks for anyone who can throw some advice my way.

Nate
next i

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Anyway to detect a new page

When I want to check if a page exists I do the following

NewSheet = "ABC"
Found = False
for each sht in thisworkbook.sheets
if sht.name = NewSheet then
Found = false
exit for
end if
next sht
if Found = False then
msgbox("Sheet doesn't exist")
else
msgbox("Found Sheet")
end if


"NateBuckley" wrote:

Sorry I may have not been clear, but i mentioned there is no "PageOn"
property of Row, the code I posted was just an example of something I'd like
to do.

I was just wondering if anyone knew of a property that is like the made up
PageOn that I simply can't find.

Thanks for your post though.

"Joel" wrote:


found = false
for i = 10 to 200
if Sheet1.Cells(i, 1).Row.PageOn < pageAt then
MsgBox("New Page")
pageAt = Sheet1.Cells(i, 1).Row.PageOn
Found = true
exit for
end if
next i
if found = true then
MsgBox("added new Page")
end if

"NateBuckley" wrote:

Hello I'd like someway to figure out if my loop ends up on a new page, and I
was wondering if there was a check to see if something is on a different page?

For example I was thinking of something along the lines:
dim pageAt as Integer
pageAt = Sheet1.Cells(10, 1).Row.PageOn

for i = 10 to 200
if Sheet1.Cells(i, 1).Row.PageOn < pageAt then
MsgBox("New Page")
pageAt = Sheet1.Cells(i, 1).Row.PageOn
end if

I know there is no PageOn method/property etc but is there anything like
that?
Thanks for anyone who can throw some advice my way.

Nate
next i

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Anyway to detect a new page

"NateBuckley" wrote:

Sorry I may have not been clear, but i mentioned there is no "PageOn"
property of Row, the code I posted was just an example of something I'd like
to do.

I was just wondering if anyone knew of a property that is like the made up
PageOn that I simply can't find.



Maybe you could use Worksheet.HPageBreaks and Worksheet.VPageBreaks

--
urkec
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
detect when columns being written to a worksheet “cross” a vertical page break gkb_cardiff Excel Worksheet Functions 0 November 28th 08 12:29 PM
Detect page break preview ward376 Excel Programming 2 December 24th 07 03:31 PM
save page ,clear page, reuse same page dave Excel Programming 1 June 6th 07 06:01 AM
Detect page break settings JR_06062005 Excel Worksheet Functions 0 January 26th 06 02:20 PM
excel fit to 1 page shows 1 page but not all data is on that page Jans Excel Programming 1 September 2nd 04 01:49 AM


All times are GMT +1. The time now is 10:08 PM.

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

About Us

"It's about Microsoft Excel"