我尝试使用公式连接某些单元格的格式化内容。
由于我不能用纯公式解决问题,所以我添加了一些基本代码。获取范围/单元格对象的格式化文本
但我不知道如何访问单个单元格中的格式化文本值。
似乎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