The following query statement works
sqlstring = "Select DocHeader, DocID from DocDetail where DocHeader IN ('15100','17200','18100')"
When I execute the command it populates my Excel Spreadsheet with all the DocHeader's and DocID's where the DocHeader's appear in the array ('15100','17200','18100')
The output will look something like this:
DocHeader DocID
15100 12348668
15100 12223886
15100 12268468
17200 56584562
18100 45846852
18100 55864868
I would like to run a similar command except that instead of identifying the array in the query I would like to select a range of cells from my spreadsheet.
I know the following isn't correct but it might give you some idea of what I want
sqlstring = "Select DocHeader, DocID from DocDetail where DocHeader IN (" & Range("A1:A1000") & ")"
Column A Rows 1 to 1000 lists all the DocHeader's that I want to have listed when the query is executed?
I am not sure how to write the query so that I can define my range from the excel sheet.
Hopefully someone can help.
Thanks.
sqlstring = "Select DocHeader, DocID from DocDetail where DocHeader IN ('15100','17200','18100')"
When I execute the command it populates my Excel Spreadsheet with all the DocHeader's and DocID's where the DocHeader's appear in the array ('15100','17200','18100')
The output will look something like this:
DocHeader DocID
15100 12348668
15100 12223886
15100 12268468
17200 56584562
18100 45846852
18100 55864868
I would like to run a similar command except that instead of identifying the array in the query I would like to select a range of cells from my spreadsheet.
I know the following isn't correct but it might give you some idea of what I want
sqlstring = "Select DocHeader, DocID from DocDetail where DocHeader IN (" & Range("A1:A1000") & ")"
Column A Rows 1 to 1000 lists all the DocHeader's that I want to have listed when the query is executed?
I am not sure how to write the query so that I can define my range from the excel sheet.
Hopefully someone can help.
Thanks.