PC Review


Reply
Thread Tools Rate Thread

Accessing Arrays stored as a Name

 
 
dustin.russell@gmail.com
Guest
Posts: n/a
 
      3rd May 2007
I am currently adapting some old VBA code and want store all my
configuration settings as Names to eliminate having a separate
worksheet for that. I have loaded strings and arrays into names and
have been successful in pulling the strings back out into my code but
when pulling the array back can only access the first value in the
array and cannot find a method to pull specific rows/columns (i.e.
array(2,3)). I have searched online and in VBA books I have and cannot
find anything on this and none of my ideas for making it work have
succeeded so does anyone know if this is even possible?


Dustin Russell

 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      3rd May 2007
Here is one way (demo'd from the immediate window)

v = Evaluate("{11,12,13,14;21,22,23,24;31,32,33,34;41,42,43,44}")
? v(1,1)
11
thisworkbook.Names.Add Name:="ABC", Refersto:=v
v1 = Evaluate(thisworkbook.Names("ABC").Value)
? v1(2,3)
23

--
Regards,
Tom Ogilvy

"(E-Mail Removed)" wrote:

> I am currently adapting some old VBA code and want store all my
> configuration settings as Names to eliminate having a separate
> worksheet for that. I have loaded strings and arrays into names and
> have been successful in pulling the strings back out into my code but
> when pulling the array back can only access the first value in the
> array and cannot find a method to pull specific rows/columns (i.e.
> array(2,3)). I have searched online and in VBA books I have and cannot
> find anything on this and none of my ideas for making it work have
> succeeded so does anyone know if this is even possible?
>
>
> Dustin Russell
>
>

 
Reply With Quote
 
Dustin R
Guest
Posts: n/a
 
      3rd May 2007
Thanks for the repy, I actually was able to figure out a method by
just declaring an empty array then assigning the names value(s) to it
Dim rptarray() As Variant
rptarray = [reports]

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing arrays returned by Oracle Stored Procedures using Oracle =?Utf-8?B?S3VtYXIuQS5QLlA=?= Microsoft Dot NET Framework 0 18th Nov 2007 04:06 PM
Saving and accessing problems with Arrays =?Utf-8?B?UGF1bCBOYXVkZQ==?= Microsoft Dot NET Framework 0 5th Jan 2006 09:36 AM
Re: Passing and receiving arrays and structures to Oracle Stored proce Val Mazur \(MVP\) Microsoft ADO .NET 0 22nd Mar 2005 01:15 AM
array of arrays stored in Name: POSSIBLE? matthewgdodds@hotmail.com Microsoft Excel Programming 1 21st Dec 2004 10:55 PM
Accessing Hashtable of Arrays George W. Microsoft C# .NET 3 22nd Oct 2004 05:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:14 PM.