This is more elegant, not mine however!!!
Dim rw
Dim cln As New Collection
Sub anagrams()
Dim word As String
word = InputBox("Enter word")
If Len(word) < 2 Then
Exit Sub
Else
rw = 1
Call mix("", word)
End If
rw = 1
For Each w In cln
Cells(rw, 1) = w
rw = rw + 1
Next w
End Sub
Sub mix(x As String, y As String) ' SOURCE UNKNOWN
Dim i As Integer, j As Integer
j = Len(y)
If j < 2 Then
If Application.CheckSpelling(x & y) = True Then
cln.Add x & y
End If
Else
For i = 1 To j
Call mix(x + Mid(y, i, 1), _
Left(y, i - 1) + Right(y, j - i))
Next
End If
End Sub
I also have an algorythm to produce all the possible words that can be
made from any letters from the longer word. However at the moment
this is highly inelegant, do you want to see this too?
------------------------------------------------
~~ Message posted from
http://www.ExcelTip.com/
~~View and post usenet messages directly from
http://www.ExcelForum.com/
~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements