ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Need to scramble letters in list of words (https://www.excelbanter.com/excel-discussion-misc-queries/80027-need-scramble-letters-list-words.html)

SusanB

Need to scramble letters in list of words
 
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

Toppers

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



All times are GMT +1. The time now is 05:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com