Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do you set your printer to manual feed a worksheet during pri. | New Users to Excel | |||
Does manual recalc attach to a worksheet | Excel Discussion (Misc queries) | |||
Count number of HPageBreaks on worksheet - examples | Excel Programming | |||
Can't set manual HPageBreaks | Excel Programming | |||
Can't set manual HPageBreaks | Excel Programming |