Need to scramble letters in list of words

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top