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

This is working code. Don't forget to save workbook else nothing will get saved. Code is:

Set obj=createobject("excel.application")
Set obj2=obj.Workbooks.Open("C:UserspushkarDesktopBook1.xls")
Set obj3=obj2.Worksheets("Sheet1")
Set obj4=obj2.Worksheets("Sheet2")
rw=obj3.usedrange.rows.count
clm=obj3.usedrange.columns.count
For i=1 to rw
For j=1 to clm
a=obj3.cells(i,j).value
If strcomp(a,"nature")=0 Then
obj4.cells(1,2)=a
End If
Next
Next
obj2.Save
obj.Quit

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of running the scripts in Hidden-mode in UFT?

680


wht type of User defined functions or Java Releated functions Do we write in VB scripting

1378


How to find the path of folder in which the test is saved in qtp?

532


if anyone has idea of the interview procedure in covansys, plz send me a mail?

1526


what are the critical test cases in crm? tell me atleast 5 critical test cases? what are the critical bug u find out while testing crm domain?

2738






What is an optional step in qtp ?

632


what is the difference between development and testing

2370


How to associate function library at a run time?

700


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

2753


Hi we are using QTP9.0 for Seibel Application and this seibel application will give you a popup messagebox which is of web , so qtp takes 3 mins to recognize the messagebox and to click on it , we have more number of messageboxes like this . please suggest me some solution

1664


Differentiate the type of test cases which can be automated and which cannot be automated?

565


Which functionalities of QTP used in banking project?

1917


How to integrate QTP with QC using VB Scripting? What are the prerequisites to connect with QC?

1272


What is optional step in qtp? How you can add optional step in qtp?

528


Explain in brief about the quicktest professional automation object model?

511