ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA question: adding a row to worksheet from recordset row (https://www.excelbanter.com/excel-programming/383233-vba-question-adding-row-worksheet-recordset-row.html)

HockeyFan

VBA question: adding a row to worksheet from recordset row
 
I'm somewhat new to VBA. I currently have to loop through a sql
recordset, which I already am able to do. I then do a search on
another workbook, looking through a sheet there to find certain things
that match my values from my recordset.
If I find a match, I want to create a row in my current
workbook.worksheet of the current row in the recordset (rsQTS.Fields).

So how do I add a row to the worksheet from a single row from a
recordset?


joel

VBA question: adding a row to worksheet from recordset row
 
Range(Cells(RowCount, 1), Cells(RowCount, SourceLastCol)).Insert (xlShiftDown)

"HockeyFan" wrote:

I'm somewhat new to VBA. I currently have to loop through a sql
recordset, which I already am able to do. I then do a search on
another workbook, looking through a sheet there to find certain things
that match my values from my recordset.
If I find a match, I want to create a row in my current
workbook.worksheet of the current row in the recordset (rsQTS.Fields).

So how do I add a row to the worksheet from a single row from a
recordset?




All times are GMT +1. The time now is 12:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com