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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export to Excel target cells

Status
Not open for further replies.

andyc209

IS-IT--Management
Dec 7, 2004
98
GB
I want to export my query data to excel which is easy enough using OpenRowset, however i want to be able to target the data to specif cells eg

Query returns a value of money that i want to put in cell B5 in excel - can i target this cell with the result?

My code to post the results at the moment is

@SQL=N'INSERT INTO OPENROWSET(''Microsoft.Jet.OLEDB.4.0'',''Excel 8.0;HDR=YES;DATABASE='+@xlFileName+''',''Select * from [Sheet1$]'')SELECT money,interest,balance FROM tbl_cash'
 
Something like

''Select * from [Sheet1$]:A1''
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top