Assigning a query to a control button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to assign a control button to a query --so that a user can click the button to make the query run rather than going thru the menus to find the query.

and... another issue Im having, can I run a query on a spreadsheet I have open?
 
Assuming you mean a pre-defined query that is already set
up within the workbook, refreshing it is quite simple -
add a command button and use code like this:

Sheets(WorksheetName).QueryTables(QueryName).Refresh

QueryName would be the name given to the query table
range - i.e. right click somewhere in the query range and
choose "Data Range Properties", you will see the name in
there.

As for the second question, don't know...
-----Original Message-----
Is there a way to assign a control button to a query --so
that a user can click the button to make the query run
rather than going thru the menus to find the query.
 

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

Back
Top