+ Reply to Thread
Results 1 to 2 of 2

How to populate cells in Sheet2 with Data Source query using cell data from Sheet1

  1. #1
    Registered User
    Join Date
    03-26-2014
    Location
    Kalamazoo, MI, USA
    MS-Off Ver
    Excel 2007
    Posts
    1

    How to populate cells in Sheet2 with Data Source query using cell data from Sheet1

    Good day, eh.
    I have a column of cells in Sheet1 and need to use the data in those cells to populate several cells in Sheet2 using a query to a data source. Currently, there are thousands of rows in sheet1 and I need to populate the same number of rows in Sheet2.
    The Sheet1!G1 cell is the cust number and will be copied to Sheet2!A1; Sheet2!B1 would be cust name; Sheet2!C1 would be cust addr; etc.
    Sheet1!G2 is copied to Sheet2!A2; Sheet2!B2 would be cust name; Sheet2!C2 would be cust addr; etc.

    Specifically, I need to use the Customer Number from the cell in Sheet1 and then query a SQL Server database to get the information for that customer number: name, address, phone, etc. I can write the SQL code; I'm just not sure how to use the cell data in the WHERE clause.

    Can I do this using an Excel data source query? or will I need to use some VB code to get the data?

  2. #2
    Registered User
    Join Date
    09-24-2013
    Location
    Twin Cities, MN
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: How to populate cells in Sheet2 with Data Source query using cell data from Sheet1

    You can use Excel's Cube formulas to hit your SQL database. Once you learn these, you'll be amazed!

+ 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. [SOLVED] Data from Sheet2 will populate if certain cell in Sheet1 have numerical value.
    By n07cn3 in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 11-03-2013, 09:59 PM
  2. Auto populate data from Sheet1 to Sheet2
    By raju_air in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-27-2013, 02:34 AM
  3. Replies: 6
    Last Post: 07-25-2013, 02:58 PM
  4. Replies: 4
    Last Post: 07-27-2008, 06:26 AM
  5. [SOLVED] How do I get data entered in sheet1 to auto populate sheet2?
    By MikeM in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-15-2006, 08:51 PM

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