PC Review


Reply
Thread Tools Rate Thread

Breakdown Excel 2007 worksheet to 65,000 worksheets for Excel 2003

 
 
=?Utf-8?B?RnJlZGR5?=
Guest
Posts: n/a
 
      5th Nov 2007

I am continually being asked to send spreadsheets to people who are still
using Excel 97-2003 and therefore still limited to 65,000 rows.

This means, in the past, I have alwasy had to cut and paste manually.

I was wondering if someone may have an idea on speeding this process up. Is
there any code around that can split a worksheet up into smaller 65,000 row
worksheets.

Thanks in advance
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SkxhdGhhbQ==?=
Guest
Posts: n/a
 
      5th Nov 2007
How about a 2-step solution?

I have an Excel 2003 workbook with code already written that is intended to
permit a person to read in a CSV file that has more than 64K rows of data and
spread it across however many sheets are required to hold it all. Right now
it is set to limit rows per page based on the version of Excel you're
running, but for your purpose we'd need to make a very small change to fix
the limit to 64K.

Then your process would be to save from your 2007 workbook to a CSV file,
open the importing book and use it to read that data back into it at 64K/page
max.

Whatcha think?

"Freddy" wrote:

>
> I am continually being asked to send spreadsheets to people who are still
> using Excel 97-2003 and therefore still limited to 65,000 rows.
>
> This means, in the past, I have alwasy had to cut and paste manually.
>
> I was wondering if someone may have an idea on speeding this process up. Is
> there any code around that can split a worksheet up into smaller 65,000 row
> worksheets.
>
> Thanks in advance

 
Reply With Quote
 
ilia
Guest
Posts: n/a
 
      5th Nov 2007
This takes the ActiveSheet as source, creates a new workbook, and
breaks up ActiveSheet into 65,000 x 250 blocks. Each sheet in the new
workbook will be named by the address range it's representing.

Public Sub SplitSheet()
Dim wshSource As Excel.Worksheet
Dim wkbDest As Excel.Workbook
Dim wshDest As Excel.Worksheet
Dim iRow As Long, iCol As Long
Dim maxRow As Long, maxCol As Long
Dim startCell As Excel.Range
Dim endCell As Excel.Range
Dim blockRange As Excel.Range
Dim calcs As XlCalculation

Application.ScreenUpdating = False
calcs = Application.Calculation
Application.Calculation = xlCalculationManual

Set wshSource = Application.ActiveSheet
Set wkbDest = Application.Workbooks.Add

maxRow = wshSource.UsedRange.Rows.Count
maxCol = wshSource.UsedRange.Columns.Count

For iRow = 1 To maxRow Step 65000
For iCol = 1 To maxCol Step 250
Set startCell = wshSource.Cells(iRow, iCol)
Set endCell = wshSource.Cells( _
Application.WorksheetFunction.Min(maxRow, iRow + 64999), _
Application.WorksheetFunction.Min(maxCol, iCol + 249))
Set blockRange = wshSource.Range(startCell, endCell)
Set wshDest = wkbDest.Worksheets.Add
wshDest.Name = Replace(startCell.Address, "$", "") & " - " & _
Replace(endCell.Address, "$", "")
blockRange.Copy wshDest.Range("A1")
DoEvents
Next iCol
Next iRow

Application.ScreenUpdating = True
Application.Calculation = calcs
End Sub


On Nov 5, 11:44 am, Freddy <Fre...@discussions.microsoft.com> wrote:
> I am continually being asked to send spreadsheets to people who are still
> using Excel 97-2003 and therefore still limited to 65,000 rows.
>
> This means, in the past, I have alwasy had to cut and paste manually.
>
> I was wondering if someone may have an idea on speeding this process up. Is
> there any code around that can split a worksheet up into smaller 65,000 row
> worksheets.
>
> Thanks in advance



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem opening Excel 97-2003 Worksheet in Excel 2007 gbr16 Microsoft Excel Crashes 0 12th Aug 2009 10:26 AM
Excel 2007: Worksheet.Move functions differently to Excel 2003, wh Bernd Wechner Microsoft Excel Programming 1 28th Jan 2009 08:56 AM
Unable to save modified Excel 2003 worksheets using Excel 2007 vkeller Microsoft Excel Misc 0 9th May 2008 10:38 PM
Excel 97-2003 Worksheet partially corupted in Excel 2007 but can't Obiwan Microsoft Excel Misc 3 13th Mar 2008 02:16 PM
breakdown a DB4 export into an excel worksheet =?Utf-8?B?SmltIGUgYm95?= Microsoft Excel Worksheet Functions 2 10th Mar 2005 03:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:08 PM.