Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default loading multiple non-contiguous range into an array

Jan,
I end up copy and paste the range into an spreadsheet. Then I read the
entire range into an array. That works for me.

Thanks.

"Jan Karel Pieterse" wrote:

Hi Matelot,

I have a selection range that is non-contiguous and want to load them into
an array. It only load the first range.
set rng = range("A1:C2,A9:C10,A15:C18")
myArray = rng.value

Anything wrong with the code? can you suggest on how to best load all the
ranges into an array.


As you have discovered, you can only bulk-read contiguous ranges into an
array. You'll have to loop through the Areas collection of the range and add
each area's cells individually.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com
Member of:
Professional Office Developer Association
www.proofficedev.com


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding the longest contiguous 1-d array of 0's MJW[_2_] Excel Discussion (Misc queries) 2 November 30th 07 11:25 PM
summing non-contiguous array cells WRC Excel Worksheet Functions 10 November 5th 07 10:26 PM
filling array with non-contiguous range koalabeer Excel Programming 3 December 28th 05 12:41 AM
change the 8th column in a not contiguous array Spencer Hutton Excel Programming 5 March 20th 05 04:37 PM
Loading Excel Array from VB Array Faster ExcelMonkey[_3_] Excel Programming 3 January 22nd 04 02:49 AM


All times are GMT +1. The time now is 12:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"