uso di For Each q in Selection

introduzione di ciclo for-g per aumentare risultati
'trasferimento risultati in foglio2

vedi
matema14.xls

Private Sub CommandButton1_Click()
'uso di For each c (=q) in selection
'introduzione di ciclo for-g per aumentare risultati
'trasferimento risultati in foglio2
Dim valore As Variant
Dim q As Variant
Dim k, h As Integer
Dim g As Integer
k = 10
h = 0
For g = 1 To 4
For Each q In Selection
valore = q.Value
If valore > 0 Then
h = h + 1
Foglio2.Cells(h, 4) = q.Value * k
Cells(h, 4) = q.Value * k
End If
Next q
Next g
End Sub


Private Sub CommandButton2_Click()
Rem cancellare
Cells(1, 1) = ""
Cells(2, 1) = ""
Cells(3, 1) = ""
Cells(4, 1) = ""
Cells(5, 1) = ""
For a = 1 To 20
Cells(a, 4) = ""
Next a
End Sub