Pergunta

I try to concatenate the formatted contents of some cells with a formula.
As I cannot see a way to solve it with a pure formula I add some basic code.

But I cannot figure out how to access the formatted text value out of the single cells.
It seems that oCell isn't a cell object, instead it is only the cell content.

How do I could change this, so I can use something like oCell.Text or 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

In Excel this one works

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

Nenhuma solução correta

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top