View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
AA2e72E AA2e72E is offline
external usenet poster
 
Posts: 400
Default database ODBC custom formula retrieval and other

Are you using ADO?

If yes, execute an SQL that returns a COUNT(*) of the number of records, say
CountR

65535 (save first row for column headers) MOD CountR gives you the number
of wheets you need; that is your loop variable

Use the PageSize property (set to 65535) to retrieve 65535 records per ADO
Recordset Page.

Use CopyFromRecordset to copy each Page to a new sheet

If you want to subselect data, write your SQL such that it selects ONLY the
data you need,