dim i,j,n,m,sum,k,t1,y as integer dim p1,p2,f as string n=0 t1=1000 sh=1 bed=2 k=9 for i=1 to t1 sum=0 y=0 for j=i+1 to t1+1 p1=cells(i,sh) p2=cells(j,sh) f=cells(j,k) if (p1=p2) and (f<>fals) then m=cells(i,bed) sum=sum+m y=1 end if next j if y=0 then sum=cells(i,bed) end if n=n+1 cells(n,4)=p1 cells(n,5)=sum cells(j,k)=fals next i