我嘗試使用公式連接某些單元格的格式化內容。
由於我不能用純公式解決問題,所以我添加了一些基本代碼。獲取範圍/單元格對象的格式化文本
但我不知道如何訪問單個單元格中的格式化文本值。
似乎oCell不是一個單元對象,而只是單元格內容。
我如何可以改變這一點,這樣我就可以使用類似 oCell.Text或oCell.String ...
Function StringSumme(oCellRange)
dim result as String
dim nRow as Integer
result = ""
For nRow = LBound(oCellRange, 1) To UBound(oCellRange, 1)
For nCol = LBound(oCellRange, 2) To UBound(oCellRange, 2)
oCell=oCellRange(nRow,1)
result = result + oCell
Next
Next
StringSumme = result
End Function
在Excel這一個工程
Function StringSumme(bezug As Range) As String
Dim txt As String
Dim ce As Range
txt = ""
For Each ce In bezug.Cells
txt = txt & ce.Text
Next
StringSumme = txt
End Function
您是否在尋找openoffice或excel中的解決方案? – assylias 2012-02-23 12:16:31
我正在尋找openoffice解決方案,我的excel解決方案工程 – jeb 2012-02-23 12:21:29
jeb,我不確定你的問題。您編寫的OO代碼完美無缺,無需在oCell之後添加任何內容 – 2012-02-24 05:33:24