VBA so cell range is criteria for odbc sql

djwbaker

New Member
Joined
Apr 4, 2014
Messages
49
Hi

I am trying to run an extract based on a range of products within excel.
I have used an odbc link but criteria remains static, looking all options up I need to write VBA to create a string based on the range and combine it to the sql

my vba is limited to autofilters, pdfs and sorting this is another level up

The range is sheet1 column A cell 2 down

my sql is

select *
from Master_Table MT
where MT.PARTNO IN (“cell range from sheet1 in spreadsheet”)
AND MT.FAC_CD = 'XX'

any help or pointer much appreciated

Cheers
Dan
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Forum statistics

Threads
1,215,530
Messages
6,125,350
Members
449,220
Latest member
Edwin_SVRZ

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