Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default only manual HpageBreaks into new worksheet

For this routine, I'd like to only make a new page for the Manual
HpageBreaks... Ron - Can you help?
Rob

http://www.rondebruin.nl/hpagebreaks.htm

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default only manual HpageBreaks into new worksheet

Dim i as Long
i = 0
For Each HPB In Asheet.HPageBreaks
i = i + 1
if HPB.Type = xlPageBreakManual or i = ASheet.HPageBreaks.count then
Set Nsheet = Worksheets.Add(after:=WB.Sheets(WB.Sheets.Count))
On Error Resume Next
Nsheet.Name = "Page " & PageNum
If Err.Number 0 Then
MsgBox "Change the name of : " & Nsheet.Name & " manually"
Err.Clear
End If
On Error GoTo 0
With Asheet
.Range(.Cells(RW, "A"), .Cells(HPB.Location.Row - 1, "K")).Copy _
Nsheet.Cells(1)
End With
' If you want to make values of your formulas use this line also
' Nsheet.UsedRange.Value = Nsheet.UsedRange.Value
RW = HPB.Location.Row
PageNum = PageNum + 1
End if
Next HPB

--
Regards,
Tom Ogilvy


"okrob" wrote:

For this routine, I'd like to only make a new page for the Manual
HpageBreaks... Ron - Can you help?
Rob

http://www.rondebruin.nl/hpagebreaks.htm


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default only manual HpageBreaks into new worksheet

On Feb 8, 7:26 am, Tom Ogilvy
wrote:
Dim i as Long
i = 0
For Each HPB In Asheet.HPageBreaks
i = i + 1
if HPB.Type = xlPageBreakManual or i = ASheet.HPageBreaks.count then
Set Nsheet = Worksheets.Add(after:=WB.Sheets(WB.Sheets.Count))
On Error Resume Next
Nsheet.Name = "Page " & PageNum
If Err.Number 0 Then
MsgBox "Change the name of : " & Nsheet.Name & " manually"
Err.Clear
End If
On Error GoTo 0
With Asheet
.Range(.Cells(RW, "A"), .Cells(HPB.Location.Row - 1, "K")).Copy _
Nsheet.Cells(1)
End With
' If you want to make values of your formulas use this line also
' Nsheet.UsedRange.Value = Nsheet.UsedRange.Value
RW = HPB.Location.Row
PageNum = PageNum + 1
End if
Next HPB

--
Regards,
Tom Ogilvy



"okrob" wrote:
For this routine, I'd like to only make a new page for the Manual
HpageBreaks... Ron - Can you help?
Rob


http://www.rondebruin.nl/hpagebreaks.htm- Hide quoted text -


- Show quoted text -


Once again, thank you sir...

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
How do you set your printer to manual feed a worksheet during pri. Printing New Users to Excel 1 March 15th 10 03:44 PM
Does manual recalc attach to a worksheet Jeff Brody Excel Discussion (Misc queries) 1 April 26th 08 12:08 AM
Count number of HPageBreaks on worksheet - examples DataFreakFromUtah Excel Programming 0 November 30th 03 04:40 PM
Can't set manual HPageBreaks J.E. McGimpsey Excel Programming 0 July 15th 03 03:52 PM
Can't set manual HPageBreaks J.E. McGimpsey Excel Programming 1 July 14th 03 08:12 PM


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