View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Deleting HPageBreaks returns...

Darlove,
Give this format a try.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


Sub GetRidOfThem()
Dim rngAll As Excel.Range
Dim rngRow As Excel.Range
Set rngAll = Range("A1:B50").Rows
For Each rngRow In rngAll
If rngRow.EntireRow.PageBreak = xlManual Then
rngRow.EntireRow.PageBreak = xlNone
End If
Next
Set rngRow = Nothing
Set rngAll = Nothing
End Sub
'----------



"darlove"
wrote in message
Thanx Jim.
It works but to my surprise only in this form, that is with Cells. When
I wanted to do the trick with a continuous range, for example

[header].EntireRow.Cells.PageBreak = xlNone (or xlPageBreakNone), or
[header].Cells.PageBreak = xlNone,

it did not work throwing the infamous error 1004. Well then, it seems
that your statement works only and exclusively for Cells and you cannot
use it with any other range of even the simplest shape. If I am wrong
in this respect, please, correct me. I'll be very thankful.

Regards
Darlove (PL)