Originally Posted by

**barim**
Thank you so much for your response. This helps a lot. I am also thinking about something. Would it be possible to have all permutations of characters. For example, ABC should produce: ACB, BAC, CBA, CAB. Number of characters should depend what I enter in the criteria cells. If I enter ABCDE it should perform permutation on all 5 characters. Thank you!

Hi barim!

maybe this is helpful to you :

Private Sub test()
Dim s$, n&, i&, arr
s = InputBox("")
n = Len(s)
ReDim arr(1 To 1, 1 To 1): arr(1, 1) = Right(s, 1)
For i = n - 1 To 1 Step -1
arr = trans(arr, Mid(s, i, 1))
Next i
[a1].CurrentRegion.ClearContents
[a1].Resize(UBound(arr)) = arr
End Sub
Function trans(ByVal arr, ByVal s1)
Dim arr1, i&, j&, n&, ln&, r&
n = UBound(arr)
ln = Len(arr(1, 1))
ReDim arr1(1 To n * (ln + 1), 1 To 1)
For j = 0 To ln
For i = 1 To n
r = r + 1
arr1(r, 1) = Left(arr(i, 1), j) & s1 & Right(arr(i, 1), ln - j)
Next i
Next j
trans = arr1
End Function