View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Toppers
 
Posts: n/a
Default Need to scramble letters in list of words

Try this UDF:

name in A1

this in B1

=scramble(a1)

Function Scramble(oldname)
n = Len(oldname)

newname = ""
Do
i = Int(Rnd() * n) + 1
c = Mid(oldname, i, 1)
If c < "*" Then
newname = newname & c
oldname = Replace(oldname, c, "*", , 1)
End If
Loop Until Len(newname) = n

Scramble = LCase(newname)

End Function

"SusanB" wrote:

I need to scramble the letters in a long list of names (i.e., from mary to
yamr). Does anyone know a way to do that?
Thank you