Option Explicit Dim reanr Private Sub katkesta_Click() Hide End Sub Private Sub korras_Click() Dim sobib, hindenr sobib = True hindenr = Val(hinne.Value) If Len(nimi.Value) < 3 Then Beep MsgBox ("Liialt lühike nimi") sobib = False ElseIf hindenr < 1 Or hindenr > 5 Then MsgBox ("Sobimatu hinne") sobib = False End If If sobib Then reanr = reanr + 1 Cells(reanr, 1) = nimi.Value Cells(reanr, 2) = hinne.Value nimi.Value = "" hinne.Value = "" End If nimi.SetFocus End Sub