Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel array formulas | Excel Discussion (Misc queries) | |||
Excel 2003 Read Only | New Users to Excel | |||
Excel Range Value issue (Excel 97 Vs Excel 2003) | Excel Discussion (Misc queries) | |||
how do I do statistic (regression) in excel? what's an array? | Excel Discussion (Misc queries) | |||
Make excel open file without Read Only dialog | Excel Discussion (Misc queries) |