if i want to produce 3 letter combination what part of the code should i modify ?
Code:Private Sub Command1_Click() Dim MyStr As String MyStr = Space$(3) 'MyStr = Space$(4) Open App.Path & "\3LetterCombinations.txt" For Output As #1 For i = 97 To 122 Mid$(MyStr, 1, 1) = Chr$(i) For J = 97 To 122 If J <> i Then Mid$(MyStr, 2, 1) = Chr$(J) For K = 97 To 122 If K <> i And K <> J Then Mid$(MyStr, 3, 1) = Chr$(K) 'For L = 97 To 122 ' If L <> i And L <> J And L <> K Then ' Mid$(MyStr, 4, 1) = Chr$(L) List1.AddItem MyStr Print #1, MyStr DoEvents ' End If 'Next End If Next End If Next Next Close #1 End Sub




Reply With Quote