View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Click Button to Load External Data Into Spreadsheet


yes you can.

when you define parameters in your query
excel can assign those parameters to cells.
when you change the cell, the query will be updated.

Paramaters..


In the Filter Data Page of the wizard..
Select :
Field1
Include only rows where :
Select Equals in 1st Dropdown
Type 1 in 2nd dropdown.

(difficult to enter the param in this box.. be patient..


Press next,next
In the Finish Page....
Select View or Edit query in MSQuery
Press finish

in MSquery

in will now say..
Criteria Field: Field1
Value : '1'

edit the '1' to [MyParameter?] no quotes!
in the popup it will ask for a value: enter a 1

Choose File/Return Data to Excel.
Now you should see :
a refedit to choose the destination..
a button to assign the Parameters to cells.


search excel help for Customize a Parameter QUery.

have fun!


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


simsjr wrote :

That's very helpful.

Now what if I wanted to have a date field where I can specify date
criteria to retrieve certain records. Is there a way to make a cell
value feed the query to this regard?


"keepITcool" wrote:


Via Data/Import external data
you create a QueryTable.

that querytable can be refreshed when you rightclick it
and choose refresh from the popup.

(alternatively you can put a button next to it to call the refresh
method of the QueryTable object)



--
keepITcool
www.XLsupport.com | keepITcool chello nl | amsterdam



simsjr wrote :

Hi Folks,

I'm trying to figure out the easiest way to create a spreadsheet
template with an "update" button on it. When clicked, this button
should tell Excel to grab data from an external database and
place it in specified columns. Furthermore, this Excel template
should be able to apply conditional formatting to the new data if
it meets certain criteria.

Do I need to know VB for this, or can a macro do this work for me?