I am trying to get all different unique permutations of 2 numbers from X numbers
I then create folders based on the result.
I've made a fundamental error in the code below as it generates 234 and 243 which are (in this case) the same.
VB Code:
Dim intItems As Integer Dim strCalcID As String Dim i As Integer Dim j As Integer intItems = 6 For i = 1 To intItems - 2 For j = 2 To intItems - 1 If j = i Then j = j + 1 End If For k = 3 To intItems If k = i Or k = j Then k = k + 1 End If 'Write which items are used to variable strCalcID = CStr(i & j & k) 'Check if directory exists If Dir(strCalcID & "\") = "" Then 'Create subdirectory based upon item identifiers fso.CreateFolder (strCalcID) End If Next Next Next




Reply With Quote