How to detect and view more than 65,536 rows when opening a DBF

4

42N83W

Excel 2002 SP3
Windows XP Pro

I'd like to be able to open a DBF file where if the DBF has more than 65,535
records that the other records would open on a new sheet in the DBF file. I
know a DBF can have only one worksheet, but this would just be a temporary
thing for viewing only.

Can this be done? Any help or suggestions appreciated.
 
R

Ron Dahl

It can be done. One method using VBA would be to:

Import the data into a ADODB.recordset
Use the Count property of the recordset to determine the number of records.
Put the first 65,000 or so records into the first worksheet by looping
through the recordset.
Either create a new worksheet or open an existing worksheet and continue
putting records into it.

Ron
 

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