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!
 

Some videos you may like

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

nbrcrunch

Well-known Member
Joined
Jan 1, 2003
Messages
2,062
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.
 

nicostick

New Member
Joined
Aug 1, 2003
Messages
25
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.
 

DRJ

MrExcel MVP
Joined
Feb 17, 2002
Messages
3,853
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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,469
Messages
5,596,327
Members
414,053
Latest member
Dual Showman

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
Top