Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Create One-Dimensional Array from Two-Dimensional Array

I need to create a one-dimensional array from a two-dimensional array. My
two-dimensional array has R * C (rows times columns) elements. I want my
one-dimensional array to have all the data from the two-dimensional array,
except for the last column, so it needs to have R * (C-1) elements.

Any ideas about how to construct this one-dimensional array?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Create One-Dimensional Array from Two-Dimensional Array

Dim varr1()
num = (ubound(varr,1) - lbound(varr,1) + 1) * _
(ubound(varr,2) - lbound(varr,2))

redim varr1(1 to num)
for i = lbound(varr,1) to ubound(varr,1)
for j = lbound(varr,2) to ubound(varr,2) - 1
k = k + 1
varr1(k) = varr(i,j)
next
Next

--
Regards,
Tom Ogilvy


"Stratuser" wrote in message
...
I need to create a one-dimensional array from a two-dimensional array. My
two-dimensional array has R * C (rows times columns) elements. I want my
one-dimensional array to have all the data from the two-dimensional array,
except for the last column, so it needs to have R * (C-1) elements.

Any ideas about how to construct this one-dimensional array?



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
Do I need a two dimensional array for this? hotherps[_17_] Excel Programming 1 February 20th 04 04:46 PM
Loading 3 Dimensional Array Alan Beban[_3_] Excel Programming 0 August 31st 03 03:00 AM
add to two dimensional array GUS Excel Programming 1 August 26th 03 12:12 AM
2 Dimensional Array Tom Ogilvy Excel Programming 0 August 18th 03 08:04 PM
2 Dimensional Array steve Excel Programming 0 August 18th 03 07:19 PM


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

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"