Jim -
See the code I added (variable is wrkname)
- sjl

Jim wrote:
I think I have it figured out with this piece of VBA saved as a macro:

Sub split_up()

Dim rLastCell As Range

Dim rCells As Range
Dim strName As String
Dim lLoop As Long, lCopy As Long
Dim wbNew As Workbook
dim wrkname

With ThisWorkbook.Sheets(1)
Set rLastCell = .Cells.Find(What:="*", After:=[A1],

For lLoop = 1 To rLastCell.Row Step 2000
lCopy = lCopy + 1
Set wbNew = Workbooks.Add
.Range(.Cells(lLoop, 1), .Cells(lLoop + 2000,
.Columns.Count)).EntireRow.Copy _
wbNew.Close SaveChanges:=True, Filename:=wrkname & lCopy & "Rows" &
lLoop & "-" & lLoop + 2000
Next lLoop
End With

End Sub

What I don't know how to do is save the orininal workbook name instead
of "chunk"........ A modification to that line of code would be very cool.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.