Append array in Excel

nicostick

New Member
Joined
Aug 1, 2003
Messages
25
Just wondering if someone may be able to help with this: I'm pulling data from Access using SQL / ADO, and putting the resulting recordset into an array. What I would like to be able to do is run this query a second or third time, with different parameters, and append the resulting recordset to the existing array.

Any suggestions would be much appreciated. Thanks in advance!
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
When you output the data, what form the does the output file take?

If it is an ascii delimited file you could always combine them using simple DOS commands.
 
Upvote 0
I'll be outputting to an Excel spreadsheet. I could output the array and then rerun the query, appending the actual Excel file, but I'd like to keep the information in memory and just do one output at the end.
 
Upvote 0
Do you want to combine the data like

MyArray(1) = this input and that input and some other input

If so try

Dim MyArray (1 To 10)

For x = 1 To 10
MyArray(x) = MyArray(x) & Something else here
Next


Now in your code each time you add data to the array just keep the origional value as well.

MyArray(?) = MyArray(?) + Something else
 
Upvote 0

Forum statistics

Threads
1,213,561
Messages
6,114,316
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top