Public Function allFactors(n) x = 1 resultString = "" For x = 1 to n If n mod x = 0 Then resultString = resultString & x & " " End If Next allFactors= Mid(resultString, 1, Len(resultString) - 1) End Function