Oops... didn't set the value of wrkname
"Jim Oberholtzer"<midrangel@xxxxxxxxxx> wrote in message
I think I have it figured out with this piece of VBA saved as a macro:
Dim rLastCell As Range
Dim rCells As Range
Dim strName As String
Dim lLoop As Long, lCopy As Long
Dim wbNew As Workbook
wrkname = ThisWorkbook.name
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,
wbNew.Close SaveChanges:=True, Filename:="Chunk"& lCopy& "Rows"&
lLoop& "-"& lLoop + 2000
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.
Chief Technical Architect
Agile Technology Architects
On 8/15/2011 9:34 AM, Jim Oberholtzer wrote:
> I have a very large workbook with one worksheet that has 53K plus rows
> in it. I need to split it up into 2000 row worksheets. This is because
> the software where the data will be uploaded to has a size limit on it's
> up load. (all local servers to me)
> Does anyone have a technique or a macro that will split an excel
> spreadsheet up into 2000 row sheets?
> -- Jim Oberholtzer Chief Technical Architect Agile Technology Architects
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.