Hi Mahesh,
Please find the below solution and confirm me
' Specify the alphabet of characters to use.
Const Chars = "abcdefghijklmnopqrstuvwxyz"
strName = ""
For k = 1 To 2
' Retrieve random digit between 0 and 25 (26 possible characters).
intValue= RandomNumber(1,25)
' Convert to character in allowed alphabet.
strChar = Mid(Chars, intValue, 1)
' Build the name.
strName = strName & strChar
Next
rValue= RandomNumber(100,999)
ExpValue=strName&rValue
Msgbox ExpValue
Thanks & Regards,
Venkat Reddy Bandaru
[email protected]
+91.9884524606
On Fri, Apr 3, 2015 at 12:24 PM, Dev Kumar <[email protected]> wrote:
> Check this Out and update as per ur req
>
> Public Function GetRandomString(ByVal iLength As Integer) As String
> Dim intMax, iLoop, k, intValue, strChar, strName, intNum
>
> ' Specify the alphabet of characters to use.
> Const Chars =
> "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ"
> ' Specify length of names.
> 'intMax = 5
> intMax = iLength
> ' Specify number of names to generate.
>
>
> Randomize
>
> strName = ""
> For k = 1 To intMax
> ' Retrieve random digit between 0 and 25 (26 possible characters).
> intValue = Fix(62 * Rnd())
> ' Convert to character in allowed alphabet.
> strChar = Mid(Chars, intValue + 1, 1)
> ' Build the name.
> strName = strName & strChar
> Next
>
> GetRandomString = strName
> End Function
>
> On Wednesday, April 1, 2015 at 5:06:29 PM UTC+5:30, Mahesh wrote:
>>
>> Need to Generate a random alpha numeric number where the first two char
>> should be alphabets and rest of them should be numbers
>>
>> example AB123456, Ac5356 MA4567
>>
>>
>>
>> --
> --
> You received this message because you are subscribed to the Google
> "QTP - HP Quick Test Professional - Automated Software Testing"
> group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "QTP - HP Quick Test Professional - Automated Software Testing" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
---
You received this message because you are subscribed to the Google Groups "QTP
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.