Function trojka(tablica As Variant) As Variant Dim zbior As Variant, s As Integer, x As Integer, m As Integer, n As Integer, i As Integer, j As Integer, r As Range Set r = Selection If IsArray(tablica) Then zbior = tablica s = 0 n = UBound(zbior, 2) - LBound(zbior, 2) + 1 'kolumny m = UBound(zbior, 1) - LBound(zbior, 1) + 1 'wiersze For i = tablica.Row To tablica.Row + m - 1 For j = tablica.Column To tablica.Column + n - 1 x = Cells(i, j).Value If x Mod 3 = 0 Then s = s + 1 End If Next j Next i trojka = s Else trojka = "argument musi byc tablica" End If End Function Sub tabela() Dim i As Integer, j As Integer, x As Integer x = 1 For i = ActiveCell.Row To ActiveCell.Row + 9 For j = ActiveCell.Column To ActiveCell.Column + 5 Cells(i, j) = x x = x + 1 Next j Next i End Sub
... zobacz całą notatkę
Komentarze użytkowników (0)