Home > Forum Home > Presenting and Reporting Data > ADP Report > Total Values in Cell with Line Feeds Share

Total Values in Cell with Line Feeds

Excel Help for Total Values In Cell With Line Feeds in Presenting and Reporting Data


Forum TopicLogin

Total Values In Cell With Line Feeds

Rate this:
(3/5 from 1 vote)
HappyTo total the values in the cell with line feeds, a modified version of the VBA macro can be used which runs on all selected cells.

VBA Code:
Sub LinesToTotal()
    Dim cr, ac As Variant
    Dim i As Integer
    Dim t As Single
    On Error Resume Next
    For Each cr In Selection
    t = 0
        ac = Split(cr.Text, Chr(10))
        For i = LBound(ac) To UBound(ac)
            t = t + Trim(ac(i))
        Next
        cr.Formula = t
    Next
End Sub
 Excel Business Forums Administrator
 Posted by on
 
View Full Post

Find relevant Excel templates and add-ins for Total Values in Cell with Line Feeds in the