Example String = ABCDE
AB, AC, AD, AE, BC, BD, BE, CD, CE, DE
ABC, ABD, ABE, ACD, ACE, ADE, BCD, BCE, CDE
ABCD, ABCE, ABDE, ACDE, BDCE
ABCDE
Option Explicit
Sub main()
ShowCombinations "", "ABCDE"
End Sub
Sub ShowCombinations(strPrefix As String, strMain As String)
If strMain = "" Then
Debug.Print strPrefix
Exit Sub
End If
Dim strFirst As String, strRest As String
strFirst = Left(strMain, 1)
strRest = Mid(strMain, 2)
ShowCombinations strPrefix & strFirst, strRest
ShowCombinations strPrefix, strRest
End Sub
--
Regards,
Tom Ogilvy
However how do I amend your code so it only produces doubles and above, no
singles
PWS
"Andrew Taylor" <andrew...@cantab.net> wrote in message
news:1142606108....@j33g2000cwa.googlegroups.com...
"Paul W Smith" <pwsN...@twelve.me.uk> wrote in message
news:441ad01d$0$9236$ed26...@ptn-nntp-reader01.plus.net...
"Tom Ogilvy" <TomO...@discussions.microsoft.com> wrote in message
news:418DF7D9-42F1-4294...@microsoft.com...