Page 3 - Adobe Premiere
P. 3
leri Excel Ders-6

2-) Örnek kod ve çıktısı

Sub ders5()
toplam = 0
sayi = 0
Sonhucre = Worksheets("sayfa1").Cells(Rows.Count, "b").End(xlUp).Row

For i = 1 To Sonhucre
If IsNumeric(Worksheets("sayfa1").Range("b" & i).Value) Then
toplam = toplam + (Worksheets("sayfa1").Range("b" & i).Value)
sayi = sayi + 1
End If

Next i
ortalama = toplam / sayi
Worksheets("sayfa1").Range("e5").Value = ortalama
End Sub
   1   2   3   4   5   6   7