View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
matpj[_2_] matpj[_2_] is offline
external usenet poster
 
Posts: 1
Default VBA to run queries in 5 different worksheets


hi there,

I've got a bit of a complex problem I need help with.
I have to write some VBA that will do the following in one go:

1. Refresh a query containing a list of names
2. On 5 worskheets I have queries that incoporate a name in the where
clause.
3 For each name returned in the refreshed query in 1. refrsh all 5
worksheets using that name in the whereclause
4. once all 5 worksheets have been refreshed, save the entire
spreadsheet as <name.xls


right, thats it in a nutshell.
I need to know where to type this VBA.
I'm not sure when modules are used etc.

I need to know how to refresh the query on the first sheet (producing
the names)
and then I need to know how to use each name to refresh the 5
subsequwnt worksheets.

any help you can offer is appreciated.
I've got a vague idea about it. but haven't a clue where to start
typing the code, and how to organise the code....

thanks in advance,
Matt


--
matpj
------------------------------------------------------------------------
matpj's Profile: http://www.excelforum.com/member.php...o&userid=21076
View this thread: http://www.excelforum.com/showthread...hreadid=472083