Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Return array of page ranges

Using Windows XP and Office 2003.

Hi, I need a function that will retrieve the range address of each defined
page range on a sheet.

For example, if page one is set to A2:H50, and page two is set to A51:H80, I
need to retrieve each of these sets of ranges. The number of pages may vary
at different times. I would prefer to work with an array if possible.

Your assistance in the form of example code would be greatly appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Return array of page ranges

Page ranges??? Do you mean print ranges or named ranges or ???
--
HTH...

Jim Thomlinson


"XP" wrote:

Using Windows XP and Office 2003.

Hi, I need a function that will retrieve the range address of each defined
page range on a sheet.

For example, if page one is set to A2:H50, and page two is set to A51:H80, I
need to retrieve each of these sets of ranges. The number of pages may vary
at different times. I would prefer to work with an array if possible.

Your assistance in the form of example code would be greatly appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Return array of page ranges


Sorry, yes, a defined print range that may include one to any number of
pages arranged vertically on the sheet.

If you switch the sheet to page break preview you can see where the page
range is defined and where the breaks will occur outline in a solid blue line.

I need an array of each of those page ranges...e.g. A2:H43, A44:H87, etc.

Thanks...

"Jim Thomlinson" wrote:

Page ranges??? Do you mean print ranges or named ranges or ???
--
HTH...

Jim Thomlinson


"XP" wrote:

Using Windows XP and Office 2003.

Hi, I need a function that will retrieve the range address of each defined
page range on a sheet.

For example, if page one is set to A2:H50, and page two is set to A51:H80, I
need to retrieve each of these sets of ranges. The number of pages may vary
at different times. I would prefer to work with an array if possible.

Your assistance in the form of example code would be greatly appreciated.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Return array of page ranges

Here is the location of the page breaks... I see that the print area you have
is A2 to ??? Is it a defined print area or is it just everything on the sheet?

Dim lngPageBreaks() As Long
Dim lng As Long
Dim hpb As HPageBreak
Dim wks As Worksheet

Set wks = ActiveSheet

For Each hpb In wks.HPageBreaks
ReDim Preserve lngPageBreaks(lng)
lngPageBreaks(lng) = hpb.Location
lng = lng + 1
Next hpb

For lng = LBound(lngPageBreaks) To UBound(lngPageBreaks)
MsgBox lngPageBreaks(lng)
Next lng
--
HTH...

Jim Thomlinson


"XP" wrote:


Sorry, yes, a defined print range that may include one to any number of
pages arranged vertically on the sheet.

If you switch the sheet to page break preview you can see where the page
range is defined and where the breaks will occur outline in a solid blue line.

I need an array of each of those page ranges...e.g. A2:H43, A44:H87, etc.

Thanks...

"Jim Thomlinson" wrote:

Page ranges??? Do you mean print ranges or named ranges or ???
--
HTH...

Jim Thomlinson


"XP" wrote:

Using Windows XP and Office 2003.

Hi, I need a function that will retrieve the range address of each defined
page range on a sheet.

For example, if page one is set to A2:H50, and page two is set to A51:H80, I
need to retrieve each of these sets of ranges. The number of pages may vary
at different times. I would prefer to work with an array if possible.

Your assistance in the form of example code would be greatly appreciated.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 434
Default Return array of page ranges

hi, ?

AFAIK, what you need could suffer variations depending on non/controlled events
(i.e. changing page-setup/printer resolution/quality, pint area-titles, printing order, and so on)

i guess you could seek for options/alternates in the following pages:

Build Table of Contents, similar listings, working with Hyperlinks
http://www.mvps.org/dmcritchie/excel/buildtoc.htm

Build TOC Another Approach
http://www.mvps.org/dmcritchie/excel/buildtoc2.htm

regards,
hector.

__ OP __
... I need a function that will retrieve the range address of each defined page range on a sheet.
For example, if page one is set to A2:H50, and page two is set to A51:H80
I need to retrieve each of these sets of ranges.
The number of pages may vary at different times.
I would prefer to work with an array if possible.
Your assistance in the form of example code would be 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
Array formula: how to join 2 ranges together to form one array? Rich_84 Excel Worksheet Functions 2 April 1st 09 06:38 PM
Return all page ranges in an array? (Repost - Tom?) slovic Excel Programming 1 February 5th 04 02:34 PM
Return an array of all page ranges in a sheet? slovical Excel Programming 1 February 4th 04 09:07 PM
variant array containing cel adresses convert to actual ranges-array Peter[_21_] Excel Programming 5 December 10th 03 09:50 PM
Array of page ranges mik[_3_] Excel Programming 4 November 26th 03 02:40 PM


All times are GMT +1. The time now is 06:09 AM.

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"