View Single Post
 
Old 03-21-2014, 10:43 AM
bobznkazoo bobznkazoo is offline Windows XP Office 2007
Novice
 
Join Date: Mar 2014
Posts: 2
bobznkazoo is on a distinguished road
Default How to populate cells in Sheet2 with Data Source query using cell data from Sheet1

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.

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