ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding rows in the array (https://www.excelbanter.com/excel-programming/426938-adding-rows-array.html)

diamond

Adding rows in the array
 
I have following code and I want to put each row (with few changes) into
array so that in the end all the "changed" rows would be in one array. Any
clue how to do this? Thanks!

Sub TestGetRows()
Dim varValues As Variant
Dim recSales As Recordset
Dim intRowCount As Integer
Dim intFieldCount As Integer
Dim SQL As Variant
Dim iSQL As Variant
Dim i As Integer
Dim j As Integer
i = 0
Set recSales = CurrentDb().OpenRecordset("xy")
varValues = recSales.GetRows(2)
recSales.Close

intFieldCount = UBound(varValues, 1)
intRowCount = UBound(varValues, 2)

For j = 0 To intRowCount
iSQL(j) = varValues(0, j) & "','" & varValues(1, j) & "','" &
varValues(2, j)


Next
End Sub


All times are GMT +1. The time now is 01:22 PM.

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