Option Explicit Private Sub Command1_Click() Dim result As Double result = Total(Text1) MsgBox result End Sub Public Function Total(ByVal txt As TextBox) As Double Dim value As Variant For Each value In Split(txt.Text, vbCrLf) Total = Total + Val(value) Next End Function