|
Sub osztalyzas() Dim j%, jo%, j5%, j4%, j3%, j2%, j1% Dim atl!, kiir% 'fejléc kiírása Cells(1, 1) = "jegyek": Cells(1, 2) = "jegyek átlaga" Cells(1, 5) = "jegyek darabszáma" Cells(2, 3) = "5": Cells(2, 4) = "4": Cells(2, 5) = "3" Cells(2, 6) = "2": Cells(2, 7) = "1" kiir = 0 j5 = 0: j4 = 0: j3 = 0: j2 = 0: j1 = 0: jo = 0 Do j = InputBox("Add a jegyeket, ha 0-t adsz, akkor vége a beolvasásnak") Cells(kiir + 3, 1) = j: jo = jo + j kiir = kiir + 1 If j = 5 Then j5 = j5 + 1 ElseIf j = 4 Then j4 = j4 + 1 ElseIf j = 3 Then j3 = j3 + 1 ElseIf j = 2 Then j2 = j2 + 1 ElseIf j = 1 Then j1 = j1 + 1 End If Loop Until j = 0 Cells(kiir + 3) = "jegy össz.": Cells(kiir + 3) = "jegy db" Cells(kiir + 4, 1) = jo: Cells(kiir + 4, 2) = kiir - 1 Cells(3, 2) = jo / (kiir - 1) Cells(3, 3) = j5: Cells(3, 4) = j4: Cells(3, 5) = j3 Cells(3, 6) = j2: Cells(3, 7) = j1 End Sub
|
|