Sub Macro1() Dim i As Integer Dim Total As Double Total = 0 For i = 1 To 9 if vartype(Activesheet.Cells(i, 1).Value) = 5 THEN total= total+Activesheet.Cells(i, 1).Value end if Next msgbox(total) End Sub>I mean translate it to VBA and save as a macro or custom function in Excel workbook.