Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VB Script - random string
#6
Solved: 9 Years, 10 Months, 2 Weeks ago
Try the below code. It ran successfully for me

Code:
Dim str

Const LETTERS = "abcdefghijklmnopqrstuvwxyz0123456789"
    
    strLen=len(LETTERS)

    For i = 1 to strLen

        str = str & Mid( LETTERS, RandomNumber( 1, Len( LETTERS ) ), 1 )

    Next

    RandomString = str
    msgbox str

Thanks,
Samir
Reply


Messages In This Thread
VB Script - random string - by qtp_user22 - 01-31-2010, 08:18 PM
RE: VB Script - random string - by qtp_user22 - 02-01-2010, 02:36 AM
RE: VB Script - random string - by Saket - 02-01-2010, 10:32 AM
RE: VB Script - random string - by rajvanan - 02-01-2010, 12:23 PM
RE: VB Script - random string - by gaveyom - 09-29-2011, 04:28 PM
RE: VB Script - random string - by roysam404 - 06-19-2014, 04:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  VB Script:number of times a character appears in a string with position Jyobtech 1 11,732 08-07-2013, 01:03 PM
Last Post: anil2u
  How to have a variable that has a string comma string .. shareq1310 5 4,783 11-09-2011, 03:33 PM
Last Post: parminderdhiman84
  How to select a option based on Random Q/A zerocool 1 2,865 09-16-2011, 04:57 AM
Last Post: vIns
  Copying random length part of the string. unbeliever 5 4,493 01-07-2010, 02:55 PM
Last Post: unbeliever
  string function to get a letter from a string ajay.r1982 3 7,356 06-30-2009, 08:58 PM
Last Post: Ankur

Forum Jump:


Users browsing this thread: 2 Guest(s)