我尝试将某些单元格的格式化内容与公式连接起来。
因为我看不到用纯公式解决它的方法,所以我添加了一些基本代码。
但我无法弄清楚如何从单个单元格中访问格式化的文本值。
似乎 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