View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
onedaywhen onedaywhen is offline
external usenet poster
 
Posts: 459
Default MS Query: Break data into separate sheets based on value?

You propose to query the database for a large (66K+ rows) of data, put
them into a text file, then conditionally query the text file to
create worksheets. Are you sure you can't apply the same logic to
conditionally query the *database* to create the worksheets? Isn't
that the point of having a database i.e. to store *all* the data and
only get the rows you need?!

--

"JB" wrote in message ...
Dick,

Thank you for your reply. Your solution would work except
that my particular situation involves too many unique
values (167+) for it to be feasible. Not to mention the
fact that I don't want to hardcode my values.

I think I'm going to change my strategy to run my query
outside of Excel and dump the data into a large text
file. Then I have a macro that will read in the text file
and create worksheets as needed.

JB

-----Original Message-----
JB

I don't think you can do that and have all the data still

be part of the
same query. However, you could have multiple queries,

one per sheet. If
you have a field that can have one of three values, for

example, you could
create three worksheets and put a query on each sheet

with the appropriate
criteria so as to limit the records for that sheet.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"JB" wrote in

message
...
Hello,

I have a spreadsheet that is populated from an external
source with a database query (ODBC). My problem is that
the query returns too many rows to fit in a single Excel
sheet.

Is there a programmatic way to split up the data into
separate worksheets, based on the value of a particular
column?

I am familiar with macro programming, although I do not
have a lot of experience. If someone could get me

started
in the right direction, I would appreciate it.

TIA,
JB



.