ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Insert HPageBreaks (https://www.excelbanter.com/excel-programming/282638-insert-hpagebreaks.html)

Robert Christie[_3_]

Insert HPageBreaks
 
Hi Everyone
Is it at all possible to insert pagebreaks in multiple
places at the same time?
The code below does not work.
Range("A38,74").Select
ActiveWindow.SelectedSheets.HPageBreaks.Add _
Befo=ActiveCell

TIA

Bob XL2002



J.E. McGimpsey

Insert HPageBreaks
 
No, but you can do this:

Dim cell As Range
For Each cell In Range("A38,A74")
ActiveWindow.SelectedSheets.HPageBreaks.Add cell
Next cell


In article ,
"Robert Christie" wrote:

Hi Everyone
Is it at all possible to insert pagebreaks in multiple
places at the same time?
The code below does not work.
Range("A38,74").Select
ActiveWindow.SelectedSheets.HPageBreaks.Add _
Befo=ActiveCell

TIA

Bob XL2002



Robert Christie[_3_]

Insert HPageBreaks
 
Hi J.e.
Thankyou for your quick reply.
I must try and get this old head of mine around the Dim'
For's and next's of this VBA.
Thanks again

Bob C.

-----Original Message-----
No, but you can do this:

Dim cell As Range
For Each cell In Range("A38,A74")
ActiveWindow.SelectedSheets.HPageBreaks.Add

cell
Next cell


In article ,
"Robert Christie"

wrote:

Hi Everyone
Is it at all possible to insert pagebreaks in multiple
places at the same time?
The code below does not work.
Range("A38,74").Select
ActiveWindow.SelectedSheets.HPageBreaks.Add _
Befo=ActiveCell

TIA

Bob XL2002


.



All times are GMT +1. The time now is 01:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com