简体   繁体   中英

Excel Stored Procedure with Excel

I have stored proc Im pulling in to excel but to get it to Run I have to enter my text exec roc 'Name' I need it to be able to have someone else thats running it be able to enter a name as they refresh the data. I dont know VBA at all and am looking for help.

I don't completely understand your question but if my assumption is correct... you want to have a cell where someone can enter some sort of name, where you can then use their input to do some other operations.

To start, you would want to grab a string variable (by grab I mean create)

Example:

Dim strName As String

Then you would want to be able to read a specific cell.... In the next example the cell will be A2

Example:

strName = Range("Sheet1!A2").Value

If you named the first sheet something different use that name. If the user inputs a name into that cell you can then use it later to do calculations or anything you want.

If you are not using VBA code then what are you using?

If using MS Query, try changing the SQL text to

{CALL roc(?)}

and IIRC this should prompt the user to enter text for the parameter value.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM