procedure TFmPrtSlMx.SumGridMx;
var
i,j:integer;
s:integer;
begin
for i:=1 to StringGrid1.Colcount-2 do
begin
s:=0;
for j:=1 to StringGrid1.RowCount-2 do
begin
try
s:=s+strtoint(StringGrid1.Cells[i,j]);
except
;
end;
end;
StringGrid1.Cells[i,StringGrid1.RowCount-1]:=inttostr(s);
end;
for j:=1 to StringGrid1.rowcount-1 do
begin
s:=0;
for i:=1 to StringGrid1.colCount-2 do
begin
try
s:=s+strtoint(StringGrid1.Cells[i,j]);
except
;
end;
end;
StringGrid1.Cells[StringGrid1.colCount-1,j]:=inttostr(s);
end;
end;