Fetching data from SQL Server to Excel on the fly

OzRiz

New Member
Joined
Oct 26, 2016
Messages
2
Hi,
I need to be able to past Part_Nos into a column in excel and Excel should be able fetch the corresponding description and cost price in the next columns which is available on a SQL data base. The number of Part_No can vary from 5 to 200.
Appreciate if you could help me to achieve this. I have basic knowledge in VB.

Thank you in advance for your help
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
One way: Retrieve PN, description, and cost through a SQL query, connecting to the server through Power Query - an add-in from MS for older versions of Excel, standard in 16 if I remember right - dumping all PNs (sounds like a small table. I'm used to dealing with lines with 30,000 PNs) to a table, and vlookup the table to fill in the specific PNs you are after.
 
Upvote 0
One way: Retrieve PN, description, and cost through a SQL query, connecting to the server through Power Query - an add-in from MS for older versions of Excel, standard in 16 if I remember right - dumping all PNs (sounds like a small table. I'm used to dealing with lines with 30,000 PNs) to a table, and vlookup the table to fill in the specific PNs you are after.

Thank you Derek73 for your prompt response. It's a workable solution, but as I am planning to build a template and distribute it to multiple users (with very limited knowledge in Excel) I would like to go with a solution where Excel picks up the data directly from the server. This way the file size will also be minimal.
Thanks again for the response and have a great weekend.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top