Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default Problem finding pagebreaks

Hi

I'm using the following code to find the pagebreaks in a worksheet and
insert a row and some column headings when it finds them. The problem
i'm having is that on the first run through the values returned to the
array containing the row of the pagebreaks are wrong. Once a row has
been inserted everything works fine and the values in the array are
correct. Has anyone come accross this before and can shed a little
light on whats happening?

Thanks

Dim varArray() As Variant
Dim intArrPosition As Integer

With Sheets("Summary")
.Activate
ActiveWorkbook.Names.Add _
"BreakRows", _
"=GET.DOCUMENT(64)"
varArray() = [BreakRows]

ActiveWorkbook.Names("BreakRows").Delete


intArrPosition = 1

If UBound(varArray) < 0 Then
Do Until intArrPosition UBound(varArray)

If intArrPosition <= UBound(varArray) Then
If Len(.Cells(varArray(intArrPosition), "A").Value) < 0
Then
If Cells(varArray(intArrPosition), "A").Value <
"Count:" Then
.Rows(varArray(intArrPosition)).Insert

insert column headings

ActiveWorkbook.Names.Add _
"BreakRows", _
"=GET.DOCUMENT(64)"
varArray() = [BreakRows]

ActiveWorkbook.Names("BreakRows").Delete
End If
End If
End If
intArrPosition = intArrPosition + 1
Loop
End If
End With

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
Is there no one who uses PageBreaks? HPageBreaks? GeorGeorGe Excel Worksheet Functions 0 February 11th 05 05:53 PM
Pagebreaks are not made Jos Vens Excel Programming 7 January 9th 05 07:16 AM
Finding existing manual pagebreaks Ragnar Midtskogen Excel Programming 6 November 20th 04 03:42 PM
pagebreaks Yiannis H. Economides Excel Programming 1 February 19th 04 04:03 PM
Excel pagebreaks Don Nicholson Excel Programming 0 September 15th 03 05:44 PM


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