Merhaba,
Aşağıdaki kodları excel VB içerisinde yazarsanız. 1,1 hücresine yazılan tam sayının faktöryelini 3,1 hücresine hesaplar.
Kolay gelsin.
Sub faktor()
Dim a As Long
Dim b As Long
If Cells(1, 1).Value <> 0 Then
a = Cells(1, 1).Value
b = a
eks: a = a - 1
If a = 1 Then GoTo son
b = b * a
GoTo eks
End If
son: Cells(3, 1).Value = b