View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Myrna Larson Myrna Larson is offline
external usenet poster
 
Posts: 863
Default Click Button to Load External Data Into Spreadsheet

A valid time only (i.e. without a date) is a number between 0 and
0.9999999999, i.e. less than 1. If 19800 represents 1:30 PM, you'll have to
develop the formula to translate 19800 to 0.5625 (the latter is equal to
13.5/24).

On Thu, 29 Jul 2004 12:25:59 -0700, simsjr
wrote:

Beautiful. That's exactly what I needed to know.

Except, once Excel populates with the data, I can't seem to change the cell

formats to translate numbers like "19800" into a usable time format like "1:30
PM"

Any ideas about why this is happening? I'm using Office 97, BTW

"keepITcool" wrote:


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?