Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default permutation of values in 2 dimensional array

Hi guys,

I have a 2 dimensional array, Positions(x,y), which has a variable
number of rows(x) and columns(y):

e.g. 4 5 3 4
500 500 800 100
450 450 750 50
400 400 700 0
350 350 -50
300

I know the number of columns and the number of rows in each column
(stored in header of column).

How can i obtain permutations of all values in each column.... i.e.
500 500 800 100
500 500 800 50
500 500 800 0
500 500 800 -50
500 500 750 100
.....
.....
.....
350 300 700 0
350 300 700 -50

I am using VBA and outputting the values to fields in excel.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default permutation of values in 2 dimensional array

rw = 1
for each cell1 in cells(2,1).Resize(cells(1,1),1)
for each cell2 in cells(2,2).Resize(cells(1,2),1)
for each cell3 in cells(2,3).Resize(cells(1,3),1)
for each cell4 in cels(2,4).Resize(cells(1,4),1)
with worksheets("sheet2")
.cells(rw,1) = cell1
.Cells(rw,2) = cell2
.Cells(rw,3) = cell3
.Cells(rw,4) = cell4
rw = rw + 1
Next cell4
next cell3
next cell2
next cell1

--
Regards,
Tom Ogilvy


" wrote:

Hi guys,

I have a 2 dimensional array, Positions(x,y), which has a variable
number of rows(x) and columns(y):

e.g. 4 5 3 4
500 500 800 100
450 450 750 50
400 400 700 0
350 350 -50
300

I know the number of columns and the number of rows in each column
(stored in header of column).

How can i obtain permutations of all values in each column.... i.e.
500 500 800 100
500 500 800 50
500 500 800 0
500 500 800 -50
500 500 750 100
.....
.....
.....
350 300 700 0
350 300 700 -50

I am using VBA and outputting the values to fields in excel.


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
Mutli-dimensional Array to Single-Dimension Array Blue Aardvark Excel Programming 3 October 15th 05 09:22 AM
3 dimensional array Sandy[_6_] Excel Programming 2 September 16th 05 02:16 PM
Create One-Dimensional Array from Two-Dimensional Array Stratuser Excel Programming 1 February 23rd 05 08:46 PM
Creating a Combination or Permutation Array in Excel D.L. Excel Programming 4 November 1st 04 05:32 PM
Do I need a two dimensional array for this? hotherps[_17_] Excel Programming 1 February 20th 04 04:46 PM


All times are GMT +1. The time now is 11:43 AM.

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"