Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel sheets linked to different msquerys 1

Status
Not open for further replies.

Cpreston

MIS
Mar 4, 2015
987
GB
Hi

Just wondering if this would be possible.

If we have a workbook (Excel 2010) and there are for example 3 sheets. Each needs to have 3 different Msquerys. Is it possible to run all 3 query's from one command button.

So sheet 1 would come up with between prompt dates then refresh sheet1 data
Then date prompts for sheet 2 would then come up and refresh data on sheet 2

etc.....

Is this possible at all? If so could someone point me in the right direction with the coding please

Many thanks
 
Hi

I don't know where you get BETWEEN 11/2/2015 AND 11/2/2015 returns dates other than 11/2/2015, the dates I set were 01/12/2015 to 28/12/2015

I will take a look at what you have sent. I am only working on my own experience with MsQuery so I am sure you are much more experienced than me in this.

I will get back with the results.

Thanks
 
In ALL your queries, the date1 and date2 parameters were BOTH pointing to THE SAME CELL: sales1!A2, which happened to be 11/2/2015!!!

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Hi

How did you create the to and from fields highlighted in yellow please?

Thanks
 
I just moved the table down 2 rows.

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Hi

okay great understand and have my sheet working like yours now. This is how I want it to work

However, I still need to draw data from the SQL server by 2 dates. So I am kind of back to square one, if I have 3 sheets all using the same dates, how do I query just once so it populates the 3 sheets.
I am now back to it asking for 3 times the prompts

Thanks
 
However, I still need to draw data from the SQL server by 2 dates.

That's exactly what my change did for you--gave you TWO CELLS for TWO DATES!

So how is it that you're "back to square one???

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Hi

Because the sheets need to be populated with information from month to month.
Just changed the dates at the top and sorry didn't realise but they then populate the other sheets with the new dates.
I thought I had to run the querys again.

So doing it this way links directly to the query and to the sql data through the link.
Not seen that before but certainly will be using it that way in the future

Thanks you so much
 
Yes! In the workbook I modified, all three QueryTables' parameters point to the same pair of From/To dates.

And yes, there is a setting in the Parameters window to "Refresh automatically when cell value changes."

Glad you finally got it worked out.



Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top