:::
OOo使用者討論區

StarBasic 如何判斷單元格是否是合并的單元格呢?

discuss pic 2009-02-05 10:35:30
如題,測試代碼如下:
Sub MergeTest
Dim oCell 'Holds a cell temporarily
Dim oRange 'The primary range
Dim oSheet 'The fourth sheet
oSheet = ThisComponent.getSheets().getByIndex(0)
oRange = oSheet.getCellRangeByName("B2:D7")
oRange.merge(True)
Print "Range merged = " & oRange.isMerged() ' True

REM Now obtain a cell that was merged
REM and I can do it!
oCell = oSheet.getCellByPosition(2, 3) 'C4
Print "Cell C4 merged = " & oCell.isMerged() ' False
oCell = oSheet.getCellByPosition(1, 1) 'B2
Print "Cell B2 merged = " & oCell.isMerged() ' True
oCell.merge(False)
End Sub

只有開始的單元格B2,它的isMerged為true!
C4是在合并的單元格里面,但是他的isMerged為False?怎么判斷它在合并單元格里面呢?
:::

快速登入

線上書籍列表

誰在線上

36人線上 (34人在瀏覽互動討論區)

會員: 0
訪客: 36

更多…