Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Setting a column of a 2D array = named range

In Excel VBA, can I assign a whole column or a whole range of a two-
dimensional array directly, to be equal to a named range?

For example, MyArray(3,5) = x assigns x to the 3rd row and 5th column
of MyArray.

But let's say I have a named range of size 1 x 8. Can I set the whole
3rd row of MyArray to be = MynamedRange ?
If yes, how? Something like MyArray(3,1 to 8) = MyNamedRange or
MyArray(3, ) = MyNamedRange - which of course don't work :(

Thanks for your help. I searched forums and the web extensively but
couldn't find anything useful
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default Setting a column of a 2D array = named range

Yes,

Dim ary As Variant

ary = Range("myRange")

--

HTH

Bob

"SantaClaus" wrote in message
...
In Excel VBA, can I assign a whole column or a whole range of a two-
dimensional array directly, to be equal to a named range?

For example, MyArray(3,5) = x assigns x to the 3rd row and 5th column
of MyArray.

But let's say I have a named range of size 1 x 8. Can I set the whole
3rd row of MyArray to be = MynamedRange ?
If yes, how? Something like MyArray(3,1 to 8) = MyNamedRange or
MyArray(3, ) = MyNamedRange - which of course don't work :(

Thanks for your help. I searched forums and the web extensively but
couldn't find anything useful



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Setting a column of a 2D array = named range

On 21 Giu, 18:32, "Bob Phillips" wrote:
Yes,

Dim ary As Variant

ary = Range("myRange")


Thanks, but I'm not sure that's what I meant.
I want ary to be, say, a 5x8 array, and I want only one raw of ary to
be = Range(myRange"), whereas I understand your code sets the whole of
ary = to the range
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default Setting a column of a 2D array = named range

I think you would need to load that manually then.

--

HTH

Bob

"SantaClaus" wrote in message
...
On 21 Giu, 18:32, "Bob Phillips" wrote:
Yes,

Dim ary As Variant

ary = Range("myRange")


Thanks, but I'm not sure that's what I meant.
I want ary to be, say, a 5x8 array, and I want only one raw of ary to
be = Range(myRange"), whereas I understand your code sets the whole of
ary = to the range



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
Named range in an array Frigster Excel Programming 5 September 8th 06 10:34 PM
Named ranges vs setting range in code Tim Excel Programming 2 February 24th 06 02:50 AM
Possible to reference column of named range in array formula? Kel Good Excel Programming 4 November 15th 05 06:44 AM
setting a range using a named list in vba Gixxer_J_97[_2_] Excel Programming 12 March 12th 05 05:11 PM
Setting named range in VBA- how to set as formula/reference instead of text string? Keith R[_3_] Excel Programming 1 July 28th 03 10:26 PM


All times are GMT +1. The time now is 01:07 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"