Sum entire row

To sum all values in a single row you can apply an Excel or a VBA method using the Excel SUM function

Example: Sum entire row

Sum entire row

METHOD 1. Sum entire row

EXCEL

=SUM(5:5)
The formula uses the Excel SUM function to sum all of the numbers in row 5.

METHOD 1. Sum entire row using VBA

VBA

Sub Sum_entire_row()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'apply the formula to sum all numbers in row 5
ws.Range("C7") = Application.WorksheetFunction.Sum(ws.Range("5:5"))

End Sub

OBJECTS
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
Range: The Range object is a representation of a single cell or a range of cells in a worksheet.
PREREQUISITES
Worksheet Name: Have a worksheet named Analysis.
Data Range: Ensure that the data that you want to sum from is captured in range ("5:5") in the Analysis worksheet.

ADJUSTABLE PARAMETERS
Date Range: Select the row that you want to sum by changing range ("5:5") to any range in the worksheet, that doesn't conflict with the formula.
Output Range: Select the output range by changing the cell reference ("C7") to any cell in the worksheet, that doesn't conflict with the formula.

Explanation about the formula used to sum entire row

EXPLANATION

EXPLANATION
To sum all values in a single row you can apply an Excel or a VBA method. The formula used to sum values in an entire row is driven by an Excel SUM function.
In both the VBA and Excel examples the formula sums all of the numbers in row 5. This is achieved through the use of the Excel SUM function.
FORMULA
=SUM(row_reference)
ARGUMENTS
row_reference: The row which you want to sum.