procedure TMainFrm.AutoWrapAndMerge(Row,Column: String);//自动会车并且合并
begin
ExcelApp.ActiveSheet.Range[Row,Column].select;
ExcelApp.ActiveSheet.Range[Row,Column].HorizontalAlignment:=1;//xlGeneral = 1;
ExcelApp.ActiveSheet.Range[Row,Column].VerticalAlignment:=$FFFFEFF4;//xlCenter = $FFFFEFF4;
ExcelApp.ActiveSheet.Range[Row,Column].WrapText:=true;
ExcelApp.ActiveSheet.Range[Row,Column].MergeCells:=true;
end;
procedure TMainFrm.SetRangemerge(Col1, Col2: String);//合并并且居中
begin
ExcelApp.ActiveSheet.Range[Col1,Col2].select;
ExcelApp.ActiveSheet.Range[Col1,Col2].HorizontalAlignment:=$FFFFEFF4;//xlCenter表示
ExcelApp.ActiveSheet.Range[Col1,Col2].VerticalAlignment:=$FFFFEFF4;
ExcelApp.ActiveSheet.Range[Col1,Col2].WrapText:=true;
ExcelApp.ActiveSheet.Range[Col1,Col2].MergeCells:=true;
ExcelApp.ActiveSheet.Range[Col1,Col2].Merge;
end;