+ Reply to Thread
Results 1 to 4 of 4

I need to loop through sheet and pass value to ADO Query and return results for each row

  1. #1
    Registered User
    Join Date
    11-18-2008
    Location
    Dallas
    Posts
    67

    I need to loop through sheet and pass value to ADO Query and return results for each row

    I need to loop thru a worksheet and pass a value to a query and return the results back to a column in the same worksheet. Basically I have a list of provider id's that i need to loop through in the worksheet and pass the id to the query and return the phone number. How would I go about setting this up? I know how to set up a query but i do not know how to loop thru the sheet and pass the value to the query and return the results for each row.


    Any help is appreciated...

    Thanks,
    Brian

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: I need to loop through sheet and pass value to ADO Query and return results for each r

    How about posting a sample workbook - desensitize the data but give us enough to work with - click on Go Advanced and then click on the paper clip
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    11-18-2008
    Location
    Dallas
    Posts
    67

    Re: I need to loop through sheet and pass value to ADO Query and return results for each r

    Attached is an example worksheet
    Attached Files Attached Files

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: I need to loop through sheet and pass value to ADO Query and return results for each r

    I guess this is what you're asking for:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Login to Peoplesoft, run a query, and return results to Excel
    By Rschwar23 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-24-2014, 07:16 PM
  2. [SOLVED] Loop over all queries and return first column of each query in consolidated table
    By learning_vba in forum Access Tables & Databases
    Replies: 2
    Last Post: 01-03-2014, 10:19 AM
  3. Replies: 0
    Last Post: 01-18-2009, 06:11 PM
  4. Return All Results from a Loop-Function
    By TomTheTrader in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-11-2008, 12:16 PM
  5. Query a table and return results into my Excel Form
    By johncassell in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-15-2007, 07:41 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1