Use the Excel built in find function to jump to the first occurrence of 
search string then retrieve the row id rather then looping around 1000 rows.
thats what i do i have 2400 test cases in excel and comparing each row with 
my string to match would take lot of time...
just a a suggestion.

On Tuesday, August 24, 2010 1:38:53 AM UTC-4, Nandeesh Kumar wrote:
>
> Hi kiran,
>  
>    Use the below code, and see the explanation below,
>  
> Set xlapp=createobject("Excel.application")
> Set wbook=xlapp.Workbooks.Open("C:\Results\Test.xlsx")
> Set wsheet=xlapp.worksheets(1)
> rw=wsheet.usedrange.rows.count
> expt="xxxx"
> For i=1 to rw
>  src=wsheet.cells(i,1).value
>  If expt=src then
>   msgbox i
>   end if
>   next
> wbook.Close
> Set wsheet=nothing
> Set wbook=nothing
> Set xlapp=nothing
>
> 1. create excel object
> 2. get total number of rows (rw)
> 3. assign expected value to variable (expt)
> 4. use for loop to find the value
> 5. in for loop assign cell value to variable by increasing row number
> 6. compare the expected and actual value
> 7. get row number
>  
> Hope it helps you.
>  
> Nandeesh
> On Mon, Aug 23, 2010 at 4:43 AM, Kiran Ogeti <[email protected]<javascript:>
> > wrote:
>
>>   I need to search for a particular value in excel spreadsheet and find 
>> out the respected row.. could you help please
>>
>> lets say I have more than 100 rows in excel , I need to find a value 
>> "xxxxx" , once found the value then retrieve the row number..
>>
>> Thanks for your help 
>>
>> -- 
>> 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]<javascript:>
>> To unsubscribe from this group, send email to
>> [email protected] <javascript:>
>> 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
"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/groups/opt_out.

Reply via email to