Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WEBEDITS Help ASAP!
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
If it is loop condition obviously u need to pass data using datatable to application

Suggestions:
1.Before sending the values to application first delete the duplicate data in datatable itself
2.Then pass the data which is without duplicates to the application


Here for second step u might not be having any issue directly u can pass the data to the application

For the first step i am giving u some advisable scenario's

Deleting a duplicate rows from excel sheet
_______________________________________________
Code:
set aa=Createobject("Excel.Application")
set b=aa.Workbooks.open("D:\batchu.xls")
set c=aa.worksheets("sheet1")
c.Cells.Sort c.Range("A1"),1,,,,,,2,1,False,,,1
m=datatable.getrowcount
m=50  'number of rows avaialable in excel sheet
for j=1 to 10 step 1 'just to find the number of duplicates even if it is more than 2 duplicates in this case i considered up to 10 duplicate records
for i=1 to m step 1
d=c.cells(i,1).value
if c.cells(i,1).value=c.cells(i+1,1).value then
'msgbox m
'msgbox c.cells(i+1,1).value
c.Rows(i+1).delete
b.save
m=m-1
'msgbox m
end if
if i=m then
'msgbox i
'msgbox m
Exit for
end if
Next
Next
'msgbox d
b.close

Please let me know if u need any informatiuon aprt from this.

Thanks,
Venkat.Batchu
Reply


Messages In This Thread
WEBEDITS Help ASAP! - by raphael - 11-12-2009, 08:51 AM
RE: WEBEDITS Help ASAP! - by venkatbatchu - 11-12-2009, 10:45 AM
RE: WEBEDITS Help - by raphael - 11-13-2009, 09:27 AM
RE: WEBEDITS Help ASAP! - by Saket - 11-12-2009, 11:04 AM
RE: WEBEDITS Help ASAP! - by Saket - 11-13-2009, 10:05 AM
RE: WEBEDITS Help ASAP! - by venkatbatchu - 11-13-2009, 10:09 AM

Forum Jump:


Users browsing this thread: 4 Guest(s)