Excel query to access database

P

Piotr

Hi,

Could you help me to find solution for my problem please?

I’m not very good in Excel and Access but have to create Excel spread sheet
which will take data from Access DB. I almost done it but have one problem
which not able to find solution.

When I create query in Excel using “Query Wizard†there is a step called
“Filter Dataâ€. I would like to use filter for the table like that: Company
Name – equals – Contoso. My problem is that instead using “Contoso†I would
like to take value from filed in Excel document (like $c$2).

Is it possible? How to do this?

Thank you and Kind Regards
 
J

Jarek Kujawa

record a macro while creating the query
Tools->Macro->Macros and select your macro, press Edit
go to the SELECT clause and change your filtering condition
accordingly

from
"WHERE (Company Name='Contoso')")

to
"WHERE (Company Name=" & Range("F1").Value & ")")

then use the macro every time you need to generate new data

HIH
pls click YES if it was helpful
 
P

Piotr

Dziekuje bardzo za pomoc i pozdrawiam.

Jarek Kujawa said:
record a macro while creating the query
Tools->Macro->Macros and select your macro, press Edit
go to the SELECT clause and change your filtering condition
accordingly

from
"WHERE (Company Name='Contoso')")

to
"WHERE (Company Name=" & Range("F1").Value & ")")

then use the macro every time you need to generate new data

HIH
pls click YES if it was helpful




.
 
J

Jarek Kujawa

proszÄ™ bardzo

postaw mi proszę ocenę (gwiazdki) jeśli Ci pomogłem
 

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