LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,388
Default how to extract 20 000 lines out of 200 000 lines automatically

Hi DD
Paste the following into a module of your main workbook.

Sub DoWhatDDNeeds5()
A = 1
B = ThisWorkbook.Name
C = ActiveSheet.Name
D = "Split " & A & ".xls"
E = 2
F = 10
Do Until Workbooks(B).Sheets(C).Cells(E, 1) = ""
D = "Split " & A & ".xls"
Workbooks.Add.SaveAs Filename:=D
Workbooks(B).Activate
Workbooks(B).Sheets(C). _
Range(Cells(E, 1), Cells(F, 8)) _
.Copy Workbooks(D).Sheets(1).Range("A2")
A = A + 1
E = F + 1
F = F + 10
Loop
End Sub

Activate the sheet that has the data, then run the code.
It will generate about 10 new workbooks called Split 1, Split 2 etc, each
containg 20,000 rows of data, and leave them all open. You need to save them
to wherever you want. Your original workbook will be unaffected.
Note: If your computer complains about not having enough memory to have all
the workbooks open, let me know.
Also, if you need header rows in each workbook, we could do that too.

Regards - Dave.
 
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
inserted lines move how to place lines in proper cell? Deschi Excel Worksheet Functions 0 February 8th 09 01:15 PM
Automatically add lines and keep formulas Matt Excel Worksheet Functions 2 October 28th 08 02:29 PM
Automatically insert lines? KJ Excel Discussion (Misc queries) 5 January 3rd 08 05:03 PM
Inserting Lines or Copying lines with formulas but without data wnfisba Excel Discussion (Misc queries) 2 August 18th 06 04:41 PM
Extract lines with VBA? Micos3 Excel Discussion (Misc queries) 9 February 16th 06 03:49 PM


All times are GMT +1. The time now is 08:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"