View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel
joel joel is offline
external usenet poster
 
Posts: 9,101
Default SQL query from one excel worksheer to another one in the same book

Not usre what you mean by "(and I can´t use Access)". I don't know if you
mean you don't how do to it in Access or is this a constraint that you want
your solution not to be one that uses access.

The best way do o this is to use a Record Macro (Tools Menu - Macro - Record
Macro). The perform the SQL query using the Data - Import External Data.
This will automatically generate a macro. Yo can then run the macro to make
sure it will run properly from excel (sometimes recorded macro need slight
modifications).

Once you have this macro, additional features can be added. You can post
these macros to get additional help.

If you don't wqnt to take the record macro approach and do your task just
with excel, then you need to post additional information at this sight to get
help which includes some sample columns and sheets that you need moved.

Look at other postings to get ideas. You can use the search feature at this
site to find similar requests.

"Vicente" wrote:

Hi,

I have an Excel book with 2 sheets. One of them is just a copy & paste
table from Access (I mean, just columns with a header). The other one
is a dynamic sheet that must be filled from the first sheet.

I need to fill it with several conditions, say I want all data from
column "user" but only if the user has "25" years. I was thinking
about using an SQL query to that worksheet, which is in the same book
as I pointed before, to get the data (and I can´t use Access).

Can I do that?

Thanks in advance.
Vicente.