![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Location: Illinois
Posts: 19
|
Hello.......
I have about 30,000 rows with 4 columns to each row. I need to make another "set" next to the first........in otherwords I need to make rows 1-15 and 16-30 on the same page with 31-45 and 46-60 on the next page. Is there an easy way to do this? Thanks Ed. [ This Message was edited by: edsjr on 2002-04-15 05:38 ] |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Aug 2003
Location: England
Posts: 4,644
|
Hello,
I know you posted this a long time ago, but I have only recently registered, and am trying to work my way through the unanswered posts, to gain as much experience as possible. I don't know if you need this any more, but I think I have come up with a solution. This code assumed columns A:D are used and the move is to columns F:I, if not you only have to play about with the numbers. Sub Macro14() Range("A1:D15").Select Do Until ActiveCell = "" For LAST = 15 To 70000 Step 15 Selection.Offset(LAST, 0).Select If ActiveCell = "" Then ADD_PAGEBREAKS End If Selection.Cut Selection.Offset(-15, 6).Select ActiveSheet.Paste Range("A1:D15").Select Selection.Offset(LAST, 0).Select Selection.Delete Shift:=xlUp Range("A1:D15").Select Next LAST Loop End Sub Sub ADD_PAGEBREAKS() Range("a16").Select Do Until ActiveCell = "" ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell Selection.Offset(15, 0).Select Loop End End Sub
__________________
------------------------- Hope this is helpful. ------------------------- only a drafter, but broadening my Excel knowledge. |
|
|
|
|
|
#3 | |
|
MrExcel MVP
Join Date: May 2002
Posts: 10,087
|
That is going back quite a while!
A suggestion when posting code. After you paste the code in the textbox in the form used for posting, select the code and click the 'Code' button just above the textbox. That formats the code for readability. Quote:
__________________
Tushar Mehta (Microsoft MVP Excel 2000-present) Excel & PowerPoint tutorials and add-ins; custom productivity solutions for MS Office |
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Aug 2003
Location: England
Posts: 4,644
|
Tursham
Thank you, your comments have been noted, I will endeavour to do this in the future.
__________________
------------------------- Hope this is helpful. ------------------------- only a drafter, but broadening my Excel knowledge. |
|
|
|
|
|
#5 |
|
New Member
Join Date: Mar 2002
Location: Illinois
Posts: 19
|
I havent been here for a while, but since you answered a couple years after I posted.....I might as well reply a couple years after that!
I ended up using asap utilities to get the job done, it did a great job and I had it done in just a few minutes. Ed. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|