may be you need a program like this
INPUT: 123
OUTPUT: 123, 213, 312, 132, 231, 321

Private Sub ArrangeAndWrite(ByVal D, i As Byte)
   '------------------------------------------
   '   siti Vi / jurangmangu / 16 mar 2008
   '   this is a recursive procedure
   '------------------------------------------
   Dim txt As String, tmp As String * 1, j As Byte

   ' limitation (if i = N)
   If i = N Then
      ' text arrangement
      For j = 1 To N: txt = txt & D(j): Next j
      ' change oCol when ....
      If oRow = MaxRow Then
         oRow = 0: oCol = oCol + 1
      End If
      ' Output / writing the arrangement to sheets'cell)
      oRow = oRow + 1:  Tulis(oRow, oCol) = txt
   Else
      For j = i To N
         ' re-Arrange Data /change betwenn 2 data
         tmp = D(j): D(j) = D(i): D(i) = tmp

         '--- i coll myself -------
          ArrangeAndWrite D, (i + 1)
         '-------------------------------------------
      Next j
   End If
End Sub

You can down load my related workbook at
http://www.box.net/shared/svi1e6c6x7




On Apr 15, 2:21 am, MD18358 <michael.e.dray...@citi.com> wrote:
> Hi All:
>
> I don't want the "number of Permutations" I want to see the
> permutations to a calculated sum.
>
> For example:  How many different ways can I get 20 by looking at the
> number 1 through 19.
> My answer should look like:
>
> 1+19
> 2+18
> 3+17
> 4+16
> ...etc
>
> Any ideas???
>
> As always, Thanks
> Michael

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,800 subscribers worldwide and receive many nice notes about the 
learning and support from the group.Let friends and co-workers know they can 
subscribe to group at http://groups.google.com/group/excel-macros/subscribe

Reply via email to