Splitting large output

Gates Is Antichrist

Well-known Member
Joined
Aug 15, 2002
Messages
1,961
Sorry, this must be FAQ'd everywhere, but I seem to be losing my Google magic.

What is the normal technique for splitting large query output (or table) down to 64K chunks for Excel? Creating a table from the query, then looping through its records in code with a 'long' variable managing it?

I hoped for something less awkward. Can you design a field that is sort of like an "autonumber" - that basically enumerates each record? Then I could query against INT(RecNo/65536) and for criteria 1 make table1, for criteria 2 make table2,etc. This still sucks for having to maintain multiple queries ... unless that part is automatable?

Some clever combinations using "TOP" might be interesting...

Unfortunately, there is not a natural grouping division to design around (e.g., if SaleMonth was a field, giving 12 natural chunks).

I am Access 2000. Standalone VB is not available.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
you could add an autonuber field to the table that would enumerate it for you.

you could set your query to ask for the criteria first and last record number when it is run.

Peter
 
Upvote 0
Using Bat17's idea - throw in an autonumber and then (re)create a query as many times as necessary to export it in pieces.
 
Upvote 0
Thanks for the help, bat. I didn't know autonumber was down in the field design choices.

So is this the way it's normally done? I thought I was just inventing a cute use of autonumber. Though autonumber has its idiosyncracies, it was enough for me today; I figured this was just a quick fix.
 
Upvote 0

Forum statistics

Threads
1,221,709
Messages
6,161,442
Members
451,705
Latest member
Priti_190

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top