Find the 'String' from excel sheet and save to another
sheet.But we don't know the string column number and row number?
Answer Posted / kishan
set xlo=createObject("Excel.Application")
xlo.visible=True
set wbo=xlo.Workbooks.open("D:\QTP\TestData\abcdef.xls")
set wso=wbo.worksheets("Sheet1")
rcnt=wso.usedRange.rowcount
ccnt=wso.usedRange.columncount
for i=1 to rcnt
for j=1 to ccnt
str=wso.cells(i,j)
position=instr(1,str,"expected_string")
if position > 1
print "Required String is in
cell"&wso.cells(i,j)
xlo.worksheets("sheet2").cells
(1,1)="expected_string"
end if
next
next
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the different types of functions available in qtp and explain ?
What is throw object?
How do you handle multiple banners(at the top the page, the banner is scrolling) in a web page(Dont take the name property(regular expression))
Is it possible to change the values of analog recording?
How to use reporter.report event in qtp ?
Can any one tell me how to write a script for selecting open option in File menu of A word document.here you have to add objects to OR.try like that and give me the ans.i asked this question to so many but no one knows.if any one know the answer plz let me know
What is the Command used to start the QTP
How to use setroproperty?
How to read a text file from QC using QTP. I would like to do something like this. But instead read a file from QC and NOT from my local drive. Set fso = CreateObject("Scripting.FileSystemObject") Set InputFile = fso.OpenTextFile("C:\test.txt", ForReading) Thanks
What contains Data Driven Framework document in qtp?
Is it possible to call from one action to another action in qtp?
How to suppress warnings from the test results page?
Can we run test with out adding object in object repository? How it is possible?
How are cgi programs, applets, javascripts, ActiveX components, etc. to be maintained, tracked, controlled, and tested?
Hi any body pls help me for QTP 11.0 software free demo version. i have to practice. Kindly send the link.or where i have to download.