split worksheet into multiple files by every 25000 rows

D

deedee

Hi,

I would like to split a worksheet with about 350000 records into multiple
files by every 25000 rows automatically. Is it possible and how?

Thanks
 
R

ryguy7272

25,000? That sounds like a lot. You must be in Excel 2007, right. Try this:
Sub PaserIntoHundreds()
Set sh = ActiveSheet
For i = 1 To 991 Step 10
Set rng = sh.Cells(i, 1).Resize(10, 1).EntireRow
Set sh1 = Worksheets.Add(after:=Worksheets(Worksheets.Count))
rng.Copy sh1.Range("A1")
' optional
'sh1.move
Next
End Sub

It parses data into 10 rows, and copies/pastes these rows, in chunks of 10,
and so on and so forth. I won't change the code to accommodate 25,000 rows
because that's going to kill my Excel 2003, but I think you can do it easy
enough.

HTH,
Ryan----
 

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