how to genarate a random numbers in vb?

Answer Posted / cnu

Function Random(max,min)
Randomize
Random=Int((max-min+1)*Rnd+min)
End Function

Dim A
A = random(100,1)
msgbox ("The random numer is:" &A)

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can the spaces from the string be removed?

591


How to make professional test report using vbscript code in UFT, which gives us complete analysis of the test.

2498


In the Web page we have a table link, if we click on that link all the contents under that link will be sorted (asscending/Descending). Now i want to check in which order the list is ? for that i need to get the data in to some var How can i get that cells data?

2021


What is the use of option explicit statement?

583


regular expression that will recognize a browser as long as its name property starts with mybrowser

1761






How to Import data from a file (file is on the desktop) to the data table

1580


how to write a vb script in QTP for yahoo registration form, i want to check the performance also like performance test, stress, load test like that.

4744


Explain the functionality of vbscript?

538


How to write functions and sub in vb script?

622


Explain the adodb.stream class?

545


What is byref and byval parameters in vbscript?

604


how to increase the values in text box in a given text box increament by two values by clicking on button

1642


Which function is used in the vbscript language to convert the specified expression into a date type value?

520


what is resorceallocation

1772


How will you get the largest subscript of an array in vbscript?

605