Function CheckDataForRange(sSheet As String) As Double
dRow = 0
dTotal = 0
Do
dRow = dRow + 1
dTotal = dTotal + Sheets(sSheet).Cells(dRow, 2).Value
Loop Until IsEmpty(Sheets(sSheet).Cells(dRow, 2).Value)
CheckDataForRange = dTotal
End Function
that function will total the column data for you and return a value, which you can then paste into the other sheet
|