Přidat otázku mezi oblíbenéZasílat nové odpovědi e-mailem Program na vypocet matematickych uloh ze srovnanim vysledku

pre robert13: skús toto (zdroj: http://www.mrexcel.com/forum/excel-questions/46997 9-permutation-excel.html):

Sub Perm()
Dim rSets As Range, rOut As Range
Dim vArr As Variant, lrow As Long

Set rSets = Range("A1").CurrentRegion
ReDim vArr(1 To rSets.Columns.Count)
Set rOut = Cells(1, rSets.Columns.Count + 2)
Perm1 rSets, vArr, rOut, 1, lrow
End Sub

Sub Perm1(rSets As Range, ByVal vArr As Variant, rOut As Range, ByVal lSetN As Long, lrow As Long)
Dim j As Long

For j = 1 To rSets.Rows.Count
If rSets(j, lSetN) = "" Then Exit Sub
vArr(lSetN) = rSets(j, lSetN)
If lSetN = rSets.Columns.Count Then
lrow = lrow + 1
rOut(lrow).Resize(1, rSets.Columns.Count).Value = vArr
Else
Perm1 rSets, vArr, rOut, lSetN + 1, lrow
End If
Next j
End Sub

Reakce na odpověď

1 Zadajte svou přezdívku:
2 Napište svou odpověď:
3 Pokud chcete dostat ban, zadejte libovolný text:

Zpět do poradny