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:
  1. Dim intItems As Integer
  2. Dim strCalcID As String
  3. Dim i As Integer
  4. Dim j As Integer
  5.  
  6. intItems = 6
  7.  
  8. For i = 1 To intItems - 2
  9.  
  10.     For j = 2 To intItems - 1
  11.         If j = i Then
  12.             j = j + 1
  13.         End If
  14.  
  15.             For k = 3 To intItems
  16.                 If k = i Or k = j Then
  17.                     k = k + 1
  18.                 End If
  19.  
  20.                 'Write which items are used to variable
  21.                 strCalcID = CStr(i & j & k)
  22.                
  23.                 'Check if directory exists
  24.                 If Dir(strCalcID & "\") = "" Then
  25.                     'Create subdirectory based upon item identifiers
  26.                     fso.CreateFolder (strCalcID)
  27.                 End If
  28.        
  29.             Next
  30.     Next
  31. Next