procedure TForm1.ToolButton32Click(Sender: TObject);
  var
      s:string;
      cellformat:f1cellformat;
  begin
    cellformat:=fbook1.getcellformat;
    s:=cellformat.NumberFormat[fbook1.handle];
    if pos('.',s)<>0 then cellformat.NumberFormat[fbook1.handle]:=s+'0'
    else
     cellformat.NumberFormat[fbook1.handle]:='#.0';
     fbook1.SetCellFormat(cellformat);
  end;procedure TForm1.ToolButton33Click(Sender: TObject);    //&frac14;&Oacute;&ETH;&iexcl;&Ecirc;&yacute;&micro;&atilde;
var
  i:integer;
  s,s2,s3,s4:string;
  cellformat:f1cellformat;
begin
  cellformat:=fbook1.getcellformat;
  s:=cellformat.NumberFormat[fbook1.handle];
   i:=length(s);
   s2:=copy(s,1,pos('.',s)-1);
   s3:=copy(s,pos('.',s),i-pos('.',s));
   if s3<>'.' then
    s4:=s2+s3
   else
    s4:=s2;
  cellformat.NumberFormat[fbook1.handle]:=s4;
  fbook1.SetCellFormat(cellformat);
end;procedure TForm1.ToolButton38Click(Sender: TObject);
var
 r1,c1,r2,c2:integer;
begin
  fbook1.getselection(0,r1,c1,r2,c2);
  fbook1.ObjCreate(5,r1,c1,r2,c2);
  fbook1.ObjBringToFront ;
end;
procedure TForm1.ToolButton39Click(Sender: TObject);
var
  cellformat:f1cellformat;
  s,s1:string;
  i,j,r1,r2,c1,c2:integer;
  cellvalue:double;
begin
 s1:='#,###.';
 fbook1.GetSelection(0,r1,c1,r2,c2);
 cellvalue:=fbook1.numberrc[r1,c1];
 cellformat:=fbook1.GetCellFormat;
 s:=cellformat.NumberFormat[fbook1.handle];
 if pos(',',s)<>0 then
  begin
  if pos('.',s)<>0 then  cellformat.NumberFormat[fbook1.handle]:='###'+copy(s,pos('.',s),length(s)-pos('.',s)+1)
   else
    cellformat.NumberFormat[fbook1.handle]:='###';
 end
 else
 begin
 if s='General'then
 begin
 if pos('.',floattostr(cellvalue))=0 then cellformat.NumberFormat[fbook1.handle]:='#,###'
 else
  begin
  i:=length(floattostr(cellvalue));
  for j:=1 to i-pos('.',floattostr(cellvalue)) do
   begin
   s1:=s1+'0';
   end;
   cellformat.NumberFormat[fbook1.handle]:=s1;
  end;
 end
 else
 cellformat.NumberFormat[fbook1.handle]:='#,###'+copy(s,pos('.',s),length(s)-pos('.',s)+1);
 end;
 fbook1.SetCellFormat(cellformat);
end;

解决方案 »

  1.   

    太多了,直接看F1book带的帮助就行了,很好懂的。
      

  2.   

    f1book对于我来说,只是用于打开excel文件
      

  3.   

    和CELL比真是没一点好,
    可能就因为  钱:=0;
    你用CELL什么版本呢出这个贴主要是看不惯有人要用这个东西收大家的钱,所以我又发软件,又发贴找技术,我也不用这个东西的,他太大了,一个破玩意1M多,
    真不知道他是不是用VB写的,但从别的地方看,还是用VC写的,有没有写上几句了,再没有的话,我把分都给一楼了