Glory
Well-known Member
- Joined
- Mar 16, 2011
- Messages
- 640
http://www.excel-vba.com/vba-code-2-12-SQL.htm
I need to be able to run an SQL query without generating any result in my Excel worksheet. That's because I'll be returning so many rows, I won't be able to fit them onto a single sheet... I need to Inner Join multiple tables and then reference the result like an external database to create a Pivot Table.
eg:
All I need to know is how to modify code like what's at the link above to build a table that I can work with using SQL through VBA.
Can anyone help with that?
I need to be able to run an SQL query without generating any result in my Excel worksheet. That's because I'll be returning so many rows, I won't be able to fit them onto a single sheet... I need to Inner Join multiple tables and then reference the result like an external database to create a Pivot Table.
eg:
Code:
Select * From C:\DOCUMENTS AND SETTINGS\DESKTOP\Book1.xls`.'Sheet1$'
UNION ALL C:\DOCUMENTS AND SETTINGS\DESKTOP\Book2.xls`.'Sheet1$'
All I need to know is how to modify code like what's at the link above to build a table that I can work with using SQL through VBA.
Can anyone help with that?