Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
what is the fastest VBA code to generate a list of random strings of a
specified length. the function prototype i want is sub GetUniqueStrings(Strings() as string, Length as long) The one i had been using seems slow when using it to generate lots of strings, and i was wondering if there was a way to speed it up. Thanks! Public Function GetUniqueString(ByVal NumChars As Long) As String Dim i As Long, str As String GetUniqueString = Space$(NumChars) For i = 1 To NumChars Mid$(GetUniqueString, i, 1) = Chr(RandBetween(97, 122)) Next i End Function Public Function RandBetween(ByVal LB As Long, ByVal UB As Long) As Long RandBetween = LB + Round(Rnd * (UB - LB), 0) End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do I generate a unique reference number??? | Excel Discussion (Misc queries) | |||
generate unique random numbers | New Users to Excel | |||
Fast way to search many cells by column for text strings | Excel Discussion (Misc queries) | |||
counting unique strings | Excel Discussion (Misc queries) | |||
Automatically Generate a unique file name... | Excel Programming |