Here is the code for the permutations, note that it prints to the debug window and not all values will be posted there as it maxes out at around 255 lines of text (or something like that). It get around this fill an array instead of printing to the debug window. It is easier to follow the logic without this extra overhead.

VB Code:
  1. Option Explicit
  2.  
  3. Private Sub Command1_Click()
  4.  Call Shuffle("1,2,3,4,5,6,7,8")
  5. End Sub
  6.  
  7. Sub Shuffle(ByVal s As String)
  8. Dim a       As Variant
  9. Dim b       As Long
  10. Dim c       As String
  11. Dim i       As Long
  12. Dim j       As Long
  13.  
  14. a = Split(s, ",")
  15. For i = 0 To 7
  16.     b = i
  17.     For j = 0 To 5
  18.         If b > 7 Then b = 0
  19.         c = c & a(b)
  20.         b = b + 1
  21.     Next j
  22.     Call Permutations(c)
  23.     c = ""
  24. Next i
  25.  
  26. End Sub
  27.  
  28.  
  29. Sub Permutations(s As String, Optional sLeading As String)
  30.  Dim i       As Long
  31.  
  32.  For i = 1 To Len(s)
  33.     If Len(s) > 2 Then
  34.         Permutations Right$(s, Len(s) - 1), sLeading & Left$(s, 1)
  35.     Else
  36.         Debug.Print sLeading & s
  37.     End If
  38.     s = Right$(s, Len(s) - 1) & Left$(s, 1)
  39.  Next
  40. End Sub