Page 1 to Page 2

S

Stanley Braverman

I am having a problem with the splitting order. If I use 50 rows per
page
Then the split and sorting order is ok. But if I want 42 rows per
page or any other amount then
The splitting order is out of proper sort.

In other words:
Page 1 plus page 2 now equals page 1
Then after moving up cleared cells
Page 2 and page 3 now equals page 2 (formally page 3 and 4)
Then after moving up cleared cells
Page 3 and page 4 now equals page 3 (formally page 5 and
6)etc..etc.etc
What needs to be changed to accomadate the different page sizes.

Thanks


Sub Move_Sets_PBreak()
Dim iSource As Long
Dim iTarget As Long

ISource= 1
ITarget= 1
Do
Cells(iSource, "A").Resize(50, 5).Cut _
Destination:=Cells(iTarget, "A")
Cells(iSource + 50, "A").Resize(50, 5).Cut _
Destination:=Cells(iTarget, "f")
ISource= iSource + 100
ITarget= iTarget + 50
PageBreak = xlPageBreakManual
Loop Until IsEmpty(Cells(iSource, "A").Value)

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top