Thread: Anagrams
View Single Post
  #3   Report Post  
Gord Dibben
 
Posts: n/a
Default

arcindo

User defined function for you....

Function SCRAMBLE(text, Optional recalc)
' Scrambles its single-cell argument
' If second argument is 1, then recalc it each time sheet is calculated
Dim Num As Integer, i As Integer, rpos As Integer
Dim temp As String, text2 As String
If IsMissing(recalc) Then recalc = 0
If recalc Then Application.Volatile
If IsArray(text) Then text2 = text(1) Else text2 = text
Num = Len(text2)
For i = 1 To Num
temp = Mid(text2, i, 1)
rpos = Int((Num - 1 + 1) * Rnd + 1)
Mid(text2, i, 1) = Mid(text2, rpos, 1)
Mid(text2, rpos, 1) = temp
Next i
SCRAMBLE = text2
End Function

Usage is =SCRAMBLE(cellref) or =SCRAMBLE(acrindo)

If you want result to be re-scrambled each time the sheet calculates....

=SCRAMBLE(arcindo,1)

Another method is by macro.........See John Walkenbach's site for code or a
downloadable workbook.

http://j-walk.com/ss/excel/tips/tip46.htm


Gord Dibben Excel MVP


On Thu, 2 Jun 2005 11:28:01 -0500, cradino
wrote:


My name is not Cradino.
Cradino is an anagram of my name "arcindo".
Who can help me developing a formula or a macro to make excel generate
combinations with all anagrams of my name??????????
Thanks