Custom Search

Friday, May 18, 2012

Creating Random string with required no of charecters

 Call GenerateRandomString(9)
Function GenerateRandomString(StrLen)
        Dim myStr
        Const MainStr= "abcdefghijklmnopqrstuvwxyz"
        For i = 1 to StrLen
          myStr=myStr & Mid(MainStr,RandomNumber(1, Len(MainStr)),1)
        Next
        GenerateRandomString = myStr
    End Function

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.