Merge multiple Ranges into one Array VBA

johnmpl

Board Regular
Joined
Jun 14, 2013
Messages
237
Office Version
  1. 365
Platform
  1. Windows


Greetings Mr. Excel community

This question is associated with Excel VBA code . How I can place multiple discontinuous ranges within Excel VBA array? The idea is to find an efficient method of doing , looking at what can be done without loops.

Example:

Rank 10 rows x 5 columns
Rank 7 Rows x 5 columns
Range 9 rows x 5 columns

Place in a continuous array of 26 rows by 5 columns.

The example is small, but must be efficient in the amount of resulting rows (about 10000+ rows ) .

Blessings !

 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi again Alan!

Thx for your response. I need an array because I want to merge lot of sheets (around 1000) into one sheet. I know that an array is a wonderful way to doy it... but construct is difficult. The idea is put all the data of each sheet in array (full), and later put it in a sheet all the data. I know do it by loops... but I don't want copy paste 1000 times. Thx for your help.
 
Upvote 0
Hi again!

I try with Array of Arrays, and time is halved (from 40 secs to 20 secs aprox). Another way to do it? Thx.
 
Upvote 0
Hi again! I try with Array of Arrays, and time is halved (from 40 secs to 20 secs aprox).
Hi again johnmpl
Please share the codes you used, and tell us what your test data looked like
_ ..............................

... Another way to do it? Thx.
I still cannot think of a way to consolidate various ranges of data into one single Array without either some looping or using a help sheet where range data is first pasted. If No-one else can think of a way, maybe I will think of something in a couple of weeks when I may be back at my Excel Computers. ( As I said before ( Post #20 ) I am "away"just now)

Alan
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

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