在线等待,急!急!急!急!急!急!急!急!急!急!
有哪位老大知道在PB中怎么通过代码实现Formula One单元格的合并??
long r1, c1, r2, c2
if Ole_1.Object.SelectionCount >1 then
messagebox("","不能合并多个选区的单元格!")
return
end if
if Ole_1.Object.SelectionCount =0 then
messagebox("","没有选定的单元格!")
return
end if
int nSelectionIndex
nSelectionIndex=0
Ole_1.Object.GetSelection(nSelectionIndex,ref r1, ref c1, ref r2, ref c2)
if c2=256 or r2=65536 then
messagebox("","不能合并整行或整列。")
return
end if
oleobject CelFont
CelFont=ole_1.object.GetCellFormat()
CelFont.MergeCells=merged
ole_1.object.SetCellFormat(CelFont)
destroy CelFont
//////////合并单元格 3,3,3,6
oleobject cellmerge
ole_1.object.setselection(3,3,3,6)
cellmerge=ole_1.object.getcellformat()
cellmerge.mergecells=true
ole_1.object.SetCellFormat(cellmerge)
ole_1.object.setselection(3,1,3,1)
cellmerge.mergecells=false
/////////////////合并结束