Greska br. 1: Nisi dimenzionisao sve promenljive, pa su one koje nisi Variant, a kasnije postaju String a ti ih sabiras sa Single (sabiras babe i zabe)
Dakle, umesto:
Code:
Dim D1 As Single, D2 As Single, D3 As Single, D4 As Single, D5 As Single, D6 As Single, D7 As Single, D As Single
treba
Code:
Dim D1 As Single, D2 As Single, D3 As Single, D4 As Single, D5 As Single, D6 As Single, D7 As Single, Dim D8 As Single, D9 As Single, D10 As Single, D11 As Single, D12 As Single, D As Single
Sto si stao kod D7 - mrzelo da ta kucas dalje?
Greska br. 2:
Umesto:
Code:
lblBroj.Caption = Round(lblBroj, 2)
treba
Code:
lblBroj.Caption = Round(D, 2)
ako si vec izracunao prosek i dodelio rezultat promenljivoj D, sto je onda ne koristis?
Greska br. 3:
Ovo ti je biser
Code:
If Text1.Text = "1" Then
lblBroj = "" And lblIme.Caption = "Nedovoljan"
End If
ne mozes tako izvrsiti dva izraza, napisi ih posebno
Code:
If Text1.Text = "1" Then
lblBroj = ""
lblIme.Caption = "Nedovoljan"
End If
To vazi i za ostale blokove, a ne samo za ovaj koji se odnosi na Text1.Text
Greska br. 4:
Ako je utvrdjeno da ima neka jedinica treba izaci iz procedure, a ne ici dalje u SELECT...CASE deo
Code:
If lblBroj = "" Then Exit Sub
Ovaj kod ces staviti pre SELECT ... CASE
Greska br. 5:
Umesto
Code:
Select Case lblBroj
Case Is < 2.5
lblIme.Caption = "Dovoljan"
Exit Sub
Case Is < 3.5
lblIme.Caption = "Dobar"
Exit Sub
Case Is < 4.5
lblIme.Caption = "Vrlo dobar"
Exit Sub
Case Is >= 4.5
lblIme.Caption = "Odlican"
End Select
treba
Code:
Select Case D
Case Is < 2.5
lblIme.Caption = "Dovoljan"
Exit Sub
Case Is < 3.5
lblIme.Caption = "Dobar"
Exit Sub
Case Is < 4.5
lblIme.Caption = "Vrlo dobar"
Exit Sub
Case Is >= 4.5
lblIme.Caption = "Odlican"
End Select
Eto, 5 gresaka - pravo cudo da ti program nije eksplodirao (naravno salim se)