Add two Ranges to Array

JStellato

Board Regular
Joined
Nov 6, 2010
Messages
55
Hello, I need to add two ranges to an array. My current code only has one range, I've tried to add a second range, but my attempts have been futile.

Here's my current code:
Code:
MyArray = Range([a3], [h30])
I've tried
Code:
MyArray = Range([a3], [h30]) & Range([i3], [p30])
and
Code:
MyArray = Range([a3], [h30])
MyArray = MyArray + Range([i3], [p30])

none of these are the right answer. Anyone have any ideas?

Thanks!
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
No problem

You may find these two articles I've written on using arrays helpful

Cheers

Dave


Using Variant Arrays in Excel VBA for Large Scale Data Manipulation http://www.experts-exchange.com/A_2684.html
a. Shows how to use variant arrays with ranges to quickly manipulate data
b. Caters for ranges that may contain single cells (which cannot be used in variant arrays)
c. This sample code removes all leading zero’s from each cell in a user selection
Creating and Writing to a CSV File Using Excel VBA Article http://www.experts-exchange.com/A_3509.html
a. Shows how to create a CSV File via VBA, a very efficient method of creating reports
b. This sample code transposes rows and columns within a selected range
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,710
Members
452,939
Latest member
WCrawford

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