
Sub m() Dim vett1(10) As Long 'dichiaro una variabile strutturata vett10 di 10 interi Dim prodotto As Long Dim i As Integer 'scarico i dieci numeri da excel al vettore vett1(0) = Cells(1, 2) vett1(1) = Cells(2, 2) vett1(2) = Cells(3, 2) vett1(3) = Cells(4, 2) vett1(4) = Cells(5, 2) vett1(5) = Cells(6, 2) vett1(6) = Cells(7, 2) vett1(7) = Cells(8, 2) vett1(8) = Cells(9, 2) vett1(9) = Cells(10, 2) prodotto = 1 For i = 0 To 9 prodotto = prodotto * vett1(i) Next MsgBox (prodotto) Cells(1, 5) = prodotto End Sub |
