Home > Forum Home > Automating Data Analysis Tasks > Send variables to MSQuery via entry in Excel cell range? | Share |
Forum Topic | Post Reply Login |
Send Variables To Msquery Via Entry In Excel Cell Range? | Rate this: (3/5 from 1 vote) |
I do a lot of data query with Excel, and am running into projects where it is impractical to continue because of query variables that change. Currently this requires that I open the query, manually chance the variable/criteria, refresh, return to Excel, print, then start over again! Specifically I'm pulling information for sales usage by a specific salesperson and date range. If there are 40 salespersons, this requires editing the MSQuery 40 times to get the data! What I'd like to do is build the Excel report to include an input cell or two (today's date (via formula) and sales ID), have that data pass directly to MSQuery and return the updated data - without having to open MSQuery. Possible? Thanks! | ||
Posted by jwhitwell on |
Replies - Displaying 11 to 12 of 12 | Order Replies By: Most recent | Chronological | Highest Rated |
Rate this: (3.5/5 from 2 votes) Run-time error '1004' General ODBC Error With the following line highlighted .Refresh BackgroundQuery:=False From google, looks like everyone is looking for a solution to this problem. Can someone please help!? Thanks! | |
Posted by StartingToLoveExcel on |
Rate this: (3/5 from 6 votes) Excel Spreadsheet:
You can then create a VBA macro which pulls the values in cells C2 and C3 to return sales starting in cell B5. The following example uses the Northwind DNS to get sales from the Order table, so you will have to change the connection, query and other options to suit your own purposes. VBA Code:
To insert the macro, go to Tools >> Macro >> Visual Basic Editor and Insert Module. Once the code has been copied and modified, you can add a button or a graphic to assign the macro to. | ||||||||||||||||||||||||||||||||
Excel Business Forums Administrator | ||||||||||||||||||||||||||||||||
Posted by Excel Helper on |
Back | Displaying page 2 of 2 |
Find relevant Excel templates and add-ins for Send variables to MSQuery via entry in Excel cell range? in the Excel Business Solutions Directory |