Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql to excel????

Status
Not open for further replies.

DirtDawg

IS-IT--Management
Apr 17, 2002
218
JP
Hello all

I have some sql tables table1 to table7. All of the tables have identical columns and rows. What I would like to do is write a macro that will take comments from each of the 7 tables and merge the data into one cell on a spreadsheet?

any help would be great.

Table layout(below)
id name product sales comments
1
2
3
4
5
6
7
8
9
10
 
Have you tried to play with the menu Data -> External data ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
...and Edit the SQL as such...
Code:
Select Sheet1.Comments
From 'C:\....\YourWorkbook.xls'.'Sheet1'
Union
Select Sheet2.Comments
From 'C:\....\YourWorkbook.xls'.'Sheet2'
Union
...etc
:-0

Skip,

[red]Be advised:[/red] [glasses]
Alcohol and Calculus do not mix!
If you drink, don't derive! [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top