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"

Answers were Sorted based on User's Feedback



1.How to find in which row or column,string "Hyderabad" exist in excel sheet? 2.How to ..

Answer / lakshmi

str="Koteswararao"
st=Split(str,"a")
Msgbox ubound(st)


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

Is This Answer Correct ?    23 Yes 1 No

1.How to find in which row or column,string "Hyderabad" exist in excel sheet? 2.How to ..

Answer / venkatesh naidu rangisetti

Option Explicit
Dim a,b,c,i,leng,var
b=0
c="a"
a="Koteswararao"
leng=len(a)
msgbox "length of"&" "&a&" "&"is"&" "&leng 'optional step

For i=1 to leng
var=mid(a,i,1)
If cstr(var)=cstr(c)Then
b=b+1
End If
Next
msgbox "Total Number of a's in Koteswararao are"&" "&b

Is This Answer Correct ?    9 Yes 1 No

1.How to find in which row or column,string "Hyderabad" exist in excel sheet? 2.How to ..

Answer / 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

1.How to find in which row or column,string "Hyderabad" exist in excel sheet? 2.How to ..

Answer / 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 ?    1 Yes 0 No

1.How to find in which row or column,string "Hyderabad" exist in excel sheet? 2.How to ..

Answer / srividya

msgbox(len("Koteswararao")-len(Replace("Koteswararao","a","")))

Is This Answer Correct ?    1 Yes 0 No

1.How to find in which row or column,string "Hyderabad" exist in excel sheet? 2.How to ..

Answer / lak

1)Find Cell data(Hyderabad)
dim obj,objwb,objsheet,search_item,found,flagrow,flagcol

Set obj=Createobject("Excel.Application")
Set objwb=obj.WorkBooks.Open("D:\Find.xls")
Set objsheet=objwb.Sheets("Sheet1")
obj.visible="True"
search_item="HYDERABAD"
set found=objsheet.Cells.Find(search_item)
On Error resume next
flagrow = found.Row
flagcol = found.Column

msgbox "Location Is : ( Row : "&flagrow&",Col :"&flagcol&")"
objwb.Save
objwb.Close
Set objwb= Nothing

'-----------------------------------------------------------
2) Repeated Character

str="Koteswararao"
repcnt=Split(str,"a")
Msgbox "Count :"&ubound(repcnt)&""

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More QTP Interview Questions

How to connect the remote desktop using QTP 9.2 explain the method or procedure?

0 Answers   Magna Infotech, Oracle,


what is the purpose of QTP?

2 Answers  


Explain advantages and disadvantages kdf?

0 Answers  


what is the latest version of QTP? Main difference between 9.2 and 10 version

0 Answers  


X flies from Hyd to bangalore using different methods of transportation. write the test scenarios and test cases for this?

0 Answers   Virtusa,






how to get the object count ?????????

8 Answers  


I want to export the datasheet to excel.Instead of total file it exports only data without headers.How to solve this problem?

1 Answers   FAI,


i have an array CAPGEMINI .....Here i need to check whether G is there or not ..how to do that and friends i have one big doubt that is whether it is array or string ,how we come to know that and where we consider that it's array ,where we consider that it's an string because when i want to find the length i have big doubt whether we need to use len function or ubound ... ans me for this TWO Questions any one please

7 Answers   Cap Gemini,


How to use descriptive programming?

0 Answers  


what do u mean by test harnesses in qtp?

1 Answers   Verizon,


What is Parameterizing Tests?

1 Answers   Crea,


Hi! Using Descriptive Programming How do we get Parent object for an object by writing script(DP). Say, i want to get a parent object for a "Link" in a web page by writing script in Descriptive Programming.

0 Answers  


Categories