Quality is delighting customers
if excel sheet contains data like a ,a in first row and a ,b in 2nd row then if data is same we have to write pass otherwise we have to write fail in 3rd row can any one help
Tags: 2nd, a, b, contains, data, excel, fail, failif, first, have, More…if, in, is, like, otherwise, pass, row, same, sheet, then, to, we, write
Permalink Reply by ^ siva kumar @ on June 24, 2012 at 9:12pm Change the path of excel sheet in vbs file .
Change the data in first and second row . Execute vbs file .
Result is stored in 3 rd row .
Permalink Reply by srinivasa reddy on June 25, 2012 at 9:18am set a=createobject("excel.application")
set b=a.workbooks.open("excel.xls")
set c=b.worksheets("sheet1")
r=c.usedrange.rowscount
c=c.usedrange.columnscount
for i=1 to r
if c.cells(i,j)=c.cells(I+1,j) then
c.cells(i,3)="pass"
else
c.cells(3,j)="fail"
j+1
end
set a=nothing
set b=nothing
set c=nothing
try it
Permalink Reply by Amit on June 25, 2012 at 9:31am I am not sure if I understood your question :)
try following in the third column/row
Assuming that you have data in Column A and B
=IF(A1=B1, "Pass","Fail")
Permalink Reply by G C Mahith Reddy on June 25, 2012 at 9:34am Hi,
You visit:
http://www.gcreddy.com/2011/09/excel-scripting.html
http://www.gcreddy.com/2010/03/excel-scripts.html
http://www.gcreddy.com/2011/07/excel-scripts.html
For Excel Object model examples in QTP Orientation
Permalink Reply by Nikhil P Rao on June 25, 2012 at 10:47pm I think srinivas is corect!!
Director - Head of Global Test Center at Barclays
© 2013 Created by Quality Testing.