|
-
Jan 31st, 2004, 07:40 PM
#1
Thread Starter
Lively Member
Excels and Arrays (Resolved)
Here's the setup, I am using arrays to store data to perform calculations in memory and then assigning the array back to the range. It's impressively quick when compared to usual excel calculation speeds.
So it's something like: (never mind the syntax this is not my main problem, but just to let you know the process)
Array = Range ("B11", "AC1200")
So first array dimension has my rows (11 to 1200), and the second array dimension has my collumns (B to AC).
I want to added a new record, or row to my table (anywhere, beginning or end is fine), but can't redim my array in my first dimension.) It lets me add extra collumns, but not rows.
I am aware that I can always write the extra row directly to the worksheet but it I still need to do more data manipulation before pasting the data.
Anyone with a solution that I can try?
Thanks
Last edited by TheFIDDLER; Feb 3rd, 2004 at 04:56 PM.
-----
#VBA, VB 6 Professional Edition, Office XP Developper. Excel 97, Excel 2000, Excel XP
I miss my VIC 20.
Never should have upgraded to my commodore 64. ...
-
Feb 2nd, 2004, 02:43 PM
#2
I think you can only Redim the last dimension, so you would have to convert your array to change the dimensions.
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
-
Feb 2nd, 2004, 05:22 PM
#3
Thread Starter
Lively Member
Can I tranpose my array? Such that my first dimension becomes my last dimension. First dimension has 1 to 867 items, Second Dimension has 1 to 27 items.
I assume this would mean transferring the data to a separate array in order to do the move.
Any ideas on how to code this?
Thanks.
- that's what I get for trying to use an array as a grid control or database....
-----
#VBA, VB 6 Professional Edition, Office XP Developper. Excel 97, Excel 2000, Excel XP
I miss my VIC 20.
Never should have upgraded to my commodore 64. ...
-
Feb 3rd, 2004, 01:45 PM
#4
Nothing easier than that:
OriginalArray (1 to A, 1 to B)
NewArray (1 to B, 1 to A)
VB Code:
for i=1 to A
for j=1 to B
NewArray(j,i)=OriginalArray(i,j)
next j
next i
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|