G
Guest
Hi All,
This is probably a easy question to answer and I have tried a few things but
with no luck. I am using a connection to a database to get some data out of
it and display it in Excel, the code looks some thing like :-
Range("A1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=XXX;UID=XXX;pword=XXXAPP=Microsoft®
Query;WSID=XXX;DATABASE=XXXX;Network=DBMSSOCN;Trusted_Connection=Yes" _
, Destination:=Range("A1"))
.CommandText = Array("select * from TABLE")
Debug.Print .CommandText
.Name = "Sheet1"
This code just places the return results in Sheet1 starting from Cell's A1,
what I would like to do is in the same module call a second select statement
and place the results in the same sheet but starting from D1, I have tried a
few things but I can only get the first select's worth of data to show and
nothing else.
If anyone could help that would be great.
Thanks
Phil
This is probably a easy question to answer and I have tried a few things but
with no luck. I am using a connection to a database to get some data out of
it and display it in Excel, the code looks some thing like :-
Range("A1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=XXX;UID=XXX;pword=XXXAPP=Microsoft®
Query;WSID=XXX;DATABASE=XXXX;Network=DBMSSOCN;Trusted_Connection=Yes" _
, Destination:=Range("A1"))
.CommandText = Array("select * from TABLE")
Debug.Print .CommandText
.Name = "Sheet1"
This code just places the return results in Sheet1 starting from Cell's A1,
what I would like to do is in the same module call a second select statement
and place the results in the same sheet but starting from D1, I have tried a
few things but I can only get the first select's worth of data to show and
nothing else.
If anyone could help that would be great.
Thanks
Phil