1.How to find in which row or column,string "Hyderabad"
exist in excel sheet?
2.How to find how many times character "a" repeated in a
given string "Koteswararao"

Answer Posted / lakshmi

Set ObjExcel=CreateObject("Excel.Application")
ObjExcel.Workbooks.Open("C:\Find.xls")
Set Obj=ObjExcel.Sheets.Item(1)
rowcount=Obj.usedrange.rows.count
colcount=Obj.usedrange.columns.count
For i=1 to rowcount
For j=1 to colcount
Aval=Obj.Cells(i,j)
If StrComp(Aval,"HYDERABAD")=0 then
MsgBox "Location Is : ("&i&","&j&")"
Exit For
Exit For
End If
Next
Next

Please let me know if you have simplest answer than this.

Thx

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

when I try to run below script in QTP "totalPages" value is 2. But i am getting error message (Type mismatch: 'totalPages' Line (): "For i=1 to totalPages".) totalPages=Browser("Name:=User").Page("Title:=User").WebElem ent("innertext:=of.*").GetROProperty("InnerText") msgbox totalPages For i=1 to totalPages rnum=Browser("Name:=User").Page("Title:=User").WebTa ble("column names:=User Name;ID;Last Name;First Name").GetRowWithCellText("store4") If rnum>0 Then r=rnum Exit for End If Browser("Name:=User").Page("Title:=User").WebElement ("html tag:=A","x:=471").Click MsgBox "Exit" Next

3260


What the differences are and best practical application of Object Repository?

581


Can anyone help.i need total excelsheet operations,shortcuts in testing environment from starting onwards....

1419


suppose in the middle of the project QTP will not work properly, then what do u do? and ur team?

1321


images are dynamically changes how to compare two images with out using the bitmap

1999






How to call a test from another test?

676


Does quicktest professional is unicode compatible?

511


Explain how qtp identifies object?

601


In what occasion we can specify global sheet and action sheet?

560


Hi, I am supposed to automate mainframe application through qtp. I do not know how to start abt it. Can you plz help me in first initializing the process or do you anybody have a guide book or a link which guides me through the process of automating the mainframe applications and things involved in it.

6651


Tell some commonly used Excel VBA functions?

587


What is action split and the purpose of using this in qtp?

531


How do you open adobe acrobat file in QTP and do some testing on that file ?

612


write script for bitmap image?

1531


how do you parameterize search button from the website? the page is a single winobject and i have made a virtual object button of search button but search box can't be converted into a winedit and if we try to convert it into winedit the value we enter in a searchbox appears as numbers in the script so we arent able to parameterize.help!!!

1724