LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 106
Default Permutation Builder

Thank you very much, this is perfect

Stephen

"Bernie Deitrick" wrote:

Stephen,

With your data table starting in cell A1, with labels in row 1, and all possible values in the
columns (without blanks between), run the macro below. This will keep the values in separate cells,
but they could just as easily be combined. (Unquote the quoted code if you want the values in one
cell - in column A.)

HTH,
Bernie
MS Excel MVP


Sub ListCombins()
Dim i As Integer
Dim j As Integer
Dim iMax As Integer
Dim jMax As Integer
Dim n As Long

iMax = Cells(Rows.Count, 1).End(xlUp).Row
jMax = Cells(Rows.Count, 2).End(xlUp).Row

n = 10
For i = 2 To iMax
For j = 2 To jMax
Cells(n, 1).Value = Cells(i, 1).Value
Cells(n, 2).Value = Cells(j, 2).Value
' Cells(n, 1).Value = Cells(n, 1).Value & " " & Cells(n, 2).Value
' Cells(n, 2).Clear
n = n + 1
Next j
Next i
End Sub








"Stephen" wrote in message
...
I have a set of columns (undefined number) with an undefined number of
parameters for each. I am looking for a way to come up with every
combination of those columns / Parameters.

For Example:

Direction TradeType
Buy Spot
Sell Fwd
Swap

Desired:

Buy Spot
Sell Spot
Buy Fwd
Sell Fwd
Buy Swap
Sell Swap

Any thoughts on how this can be done?

Thanks




 
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
Answer in function builder but not in worksheet Ms. Z Excel Worksheet Functions 2 December 1st 06 05:36 PM
Simple Equation Builder/Solver in Excel for use in Dell Axim X51v Clarence Crow Excel Worksheet Functions 0 July 21st 06 09:16 PM
Permutation in excel Sweden Excel Worksheet Functions 2 September 25th 05 05:05 PM
Permutation in excel Sweden Excel Worksheet Functions 2 September 16th 05 06:49 PM
Permutation Output Tuna Witch Excel Worksheet Functions 2 December 21st 04 09:09 PM


All times are GMT +1. The time now is 11:14 PM.

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

About Us

"It's about Microsoft Excel"