A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Setting up and Configuration of Excel
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Excel, read in an array



 
 
Thread Tools Display Modes
  #1  
Old September 19th 05, 08:09 PM
AustinJames
external usenet poster
 
Posts: n/a
Default Excel, read in an array

Hey all -

I've got an array in my worksheet with values that can and probably will
change.

I'm writing a macro to read it into an array. Then once there I can perform
calculations. Its at 15x15 array. I just can't figure out how to bring the
data into the array! I can bump through the rows, i just can't figure out
how to iterate through the columns. Or is there a better way to do it?

Thanks in advance
Ads
  #2  
Old September 20th 05, 12:21 AM
Rowan
external usenet poster
 
Posts: n/a
Default

Maybe this would work for you:

Dim myArray As Variant
myArray = Range("A1:O15").Value

Hope this helps
Rowan

AustinJames wrote:
> Hey all -
>
> I've got an array in my worksheet with values that can and probably will
> change.
>
> I'm writing a macro to read it into an array. Then once there I can perform
> calculations. Its at 15x15 array. I just can't figure out how to bring the
> data into the array! I can bump through the rows, i just can't figure out
> how to iterate through the columns. Or is there a better way to do it?
>
> Thanks in advance

  #3  
Old September 20th 05, 02:21 PM
AustinJames
external usenet poster
 
Posts: n/a
Default

When I try that i get an error:

Can't assign to array.

So i guess you can't assign the .Value property to an array. Thanks for the
idea. Any others?




"Rowan" wrote:

> Maybe this would work for you:
>
> Dim myArray As Variant
> myArray = Range("A1:O15").Value
>
> Hope this helps
> Rowan
>
> AustinJames wrote:
> > Hey all -
> >
> > I've got an array in my worksheet with values that can and probably will
> > change.
> >
> > I'm writing a macro to read it into an array. Then once there I can perform
> > calculations. Its at 15x15 array. I just can't figure out how to bring the
> > data into the array! I can bump through the rows, i just can't figure out
> > how to iterate through the columns. Or is there a better way to do it?
> >
> > Thanks in advance

>

  #4  
Old September 20th 05, 02:50 PM
Dave Peterson
external usenet poster
 
Posts: n/a
Default

Rowan used:
dim myArray as Variant

Did you change that?

If you did, change it back.

AustinJames wrote:
>
> When I try that i get an error:
>
> Can't assign to array.
>
> So i guess you can't assign the .Value property to an array. Thanks for the
> idea. Any others?
>
> "Rowan" wrote:
>
> > Maybe this would work for you:
> >
> > Dim myArray As Variant
> > myArray = Range("A1:O15").Value
> >
> > Hope this helps
> > Rowan
> >
> > AustinJames wrote:
> > > Hey all -
> > >
> > > I've got an array in my worksheet with values that can and probably will
> > > change.
> > >
> > > I'm writing a macro to read it into an array. Then once there I can perform
> > > calculations. Its at 15x15 array. I just can't figure out how to bring the
> > > data into the array! I can bump through the rows, i just can't figure out
> > > how to iterate through the columns. Or is there a better way to do it?
> > >
> > > Thanks in advance

> >


--

Dave Peterson
  #5  
Old September 20th 05, 03:18 PM
AustinJames
external usenet poster
 
Posts: n/a
Default

Got it. Thanks

"Dave Peterson" wrote:

> Rowan used:
> dim myArray as Variant
>
> Did you change that?
>
> If you did, change it back.
>
> AustinJames wrote:
> >
> > When I try that i get an error:
> >
> > Can't assign to array.
> >
> > So i guess you can't assign the .Value property to an array. Thanks for the
> > idea. Any others?
> >
> > "Rowan" wrote:
> >
> > > Maybe this would work for you:
> > >
> > > Dim myArray As Variant
> > > myArray = Range("A1:O15").Value
> > >
> > > Hope this helps
> > > Rowan
> > >
> > > AustinJames wrote:
> > > > Hey all -
> > > >
> > > > I've got an array in my worksheet with values that can and probably will
> > > > change.
> > > >
> > > > I'm writing a macro to read it into an array. Then once there I can perform
> > > > calculations. Its at 15x15 array. I just can't figure out how to bring the
> > > > data into the array! I can bump through the rows, i just can't figure out
> > > > how to iterate through the columns. Or is there a better way to do it?
> > > >
> > > > Thanks in advance
> > >

>
> --
>
> Dave Peterson
>

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel array formulas Les Gordon Excel Discussion (Misc queries) 1 September 3rd 05 04:12 PM
Excel 2003 Read Only helpexcel New Users to Excel 0 August 8th 05 04:57 PM
Excel Range Value issue (Excel 97 Vs Excel 2003) Keeno Excel Discussion (Misc queries) 2 June 13th 05 02:01 PM
how do I do statistic (regression) in excel? what's an array? trish Excel Discussion (Misc queries) 1 May 7th 05 02:43 PM
Make excel open file without Read Only dialog Saul Margolis Excel Discussion (Misc queries) 2 March 16th 05 03:30 PM


All times are GMT +1. The time now is 01:19 PM.


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