Search code examples
excelvbscriptqtphp-uft

Write into an excel cell that already has a value and not write over previous val


Is it possible to write into an excel cell that already has value, and not delete what's already there? So just add to what's already in there.

So for example, I have a for each loop that gets a diff value and I want it all to go into one cell. Is that possible?


Solution

  • Sure.............place a value in cell A1 and:

    Sub Addup()
        For i = 1 To 10
        With Range("A1")
            .Value = .Value + i
        End With
        Next i
    End Sub