'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''SCRIPT NAME: Select Random Web List Value ''' '''SCRIPT CREATOR: Automated Testing Institute ''' '''SCRIPT OBJECTIVE: The objective of this script is to randomly generate a name ''' from a known array of names '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Function GenerateRandomName() 'Declare Variables Dim objIE Dim nameArray Dim nameCount Dim randomInt 'Get a collection of all list items (options objects) nameArray = Array("John", "Becky", "Mike", "Sue", "Peter", "Linda", "John", "Mattie", "Frank", "Betty", "Timmy", "Ellen", "Lynwood", "Christine") 'Get a count of the total number of items in the collection nameCount =UBound(nameArray) 'Use random number generator to randomly select a name array index Randomize randomInt = Int(nameCount * Rnd) GenerateRandomName = nameArray(randomInt) End Function 'Select the random name from the array msgbox "The random name chosen from the list is: " & GenerateRandomName