fattoriale1
esempio di VBA
con powerpoint per confrontare con VBA su excel
esci con verifiche24.htm
creazione funzione fattoriale con vba powerpoint
Private Sub
CommandButton1_Click()
Dim n As Integer
n = Val(TextBox1)
ListBox1.AddItem (fattoriale(n))
ListBox1.AddItem ("fattoriale con n = " & n &
" = " & fattoriale(n))
ListBox1.AddItem ("-----")
End Sub
Public Function fattoriale(x As Integer)
Dim a, k As Integer
Dim f As Long
f = 1
a = x
For k = 1 To a
f = f * k
Next k
fattoriale = f
End Function
Private Sub UserForm_Click()
End Sub
fattoriale2.xls excel e vba excel
Private Sub CommandButton1_Click()
Dim n As Integer
n = Val(TextBox1)
ListBox1.AddItem (fattoriale(n))
ListBox1.AddItem ("fattoriale con n = " & n &
" = " & fattoriale(n))
ListBox1.AddItem ("-----")
End Sub
Public Function fattoriale(x As Integer)
Dim a, k As Integer
Dim f As Long
f = 1
a = x
For k = 1 To a
f = f * k
Next k
fattoriale = f
End Function
Private Sub UserForm_Click()
End Sub
Private Sub CommandButton2_Click()
ListBox1.Clear
End Sub