Use the formula
=GETDIVISORS(A1)
where GETDIVISORS is this UDF, and A1 houses 50. This formula returns an Array, so, if you want to see all the results, you must array enter it over a range (For example, in B1:B6 to get the results of 50)
<pre>Function GETDIVISORS(Num As Long) As Variant
Dim Ar As Variant
Dim Ar2
Dim i As Long
Dim Ctr As Long
Ar = Application.Evaluate("IF(MOD(" & Num & ",ROW(1:" & Num & "))=0,ROW(1:" & Num & "),"""")")
ReDim Ar2(1 To Application.Count(Ar), 1 To 1)
For i = 1 To Num
If IsNumeric(Ar(i, 1)) Then
Ctr = Ctr + 1
Ar2(Ctr, 1) = Ar(i, 1)
End If
Next i
GETDIVISORS = Ar2
End Function</pre>