Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Transfer Range to Array

I've forgotten how to transfer a range to an array without stepping through
the cells one at a time.

I know you can transfer an array to a range with TheRange.Value = MyArray as
long as the dimensions of the array and range match. And you can transfer a
one-dimensional array with
Range("A1:A100").Value = Application.WorksheetFunction.Transpose(MyArray)

Which transposes an array to a vertical column in Excel.

But I can't remember the reverse -- range -- array.

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Transfer Range to Array

Dim myArray as Variant
Dim theRange as Range
set theRange = ActiveSheet.UsedRange
myArray = theRange.Value

will give a two dimensional array, dimensions are 1 based.

--
Regards,
Tom Ogilvy

Steven Drenker wrote in message
...
I've forgotten how to transfer a range to an array without stepping

through
the cells one at a time.

I know you can transfer an array to a range with TheRange.Value = MyArray

as
long as the dimensions of the array and range match. And you can transfer

a
one-dimensional array with
Range("A1:A100").Value = Application.WorksheetFunction.Transpose(MyArray)

Which transposes an array to a vertical column in Excel.

But I can't remember the reverse -- range -- array.

Thanks.



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
How to transfer specific range to another range ? ghost Excel Discussion (Misc queries) 0 June 11th 08 05:10 PM
How to fix an array or range delboy Excel Discussion (Misc queries) 1 February 12th 08 08:14 PM
How to transfer text to an sheet if the cells en range contains a mia_kit Excel Discussion (Misc queries) 2 May 24th 07 04:40 PM
Named Range Transfer Graham Haughs Excel Discussion (Misc queries) 9 February 21st 07 02:58 PM
Range as array Chip Pearson Excel Programming 0 September 10th 03 10:40 PM


All times are GMT +1. The time now is 07:52 AM.

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"