Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to create a macro that runs a SQL query and assigns the output to the
next row in the report. The report is additive, new data is always added to the next available row. How do you assign the SQL output to the next row? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Tue, 20 Mar 2007 07:52:05 -0700, rick_mc
wrote: I need to create a macro that runs a SQL query and assigns the output to the next row in the report. The report is additive, new data is always added to the next available row. How do you assign the SQL output to the next row? Something like this: Dim rng As Range Dim rs As ADODB.Recordset Set rng = Sheet1.Cells(Sheet1.Rows.Count, 1).End(xlUp).Offset(1, 0) 'Get recordset here rng.CopyFromRecordset rs -- Dick Kusleika Microsoft MVP-Excel http://www.dailydoseofexcel.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem adding vertical marker line to line chart | Charts and Charting in Excel | |||
macro from columns to rows but adding every time a new line | Excel Discussion (Misc queries) | |||
Run macro when adding a new line | Excel Programming | |||
Chart Type - Line Column adding a 2nd line | Charts and Charting in Excel | |||
adding a line at the end of a macro to name the cell | Excel Programming |