Aavg = Application.Subtotal(1, Worksheets("raw").Range(Cells(sp, 7), Cells(ep, 7)))
Worksheets("kinematic").Activate
ActiveCell.Offset(0, 9).Value = Aavg
Aavg = Application.Subtotal(1, Worksheets("raw").Range(Cells(sp, 7), Cells(ep, 7)))
Worksheets("kinematic").Activate
If IsError(Aavg) Then
'Do nothing
Else
ActiveCell.Offset(0, 9).Value = Aavg
End If