Private Sub nupp1_Click() txtSentimeetrid = Str(Val(txtTollid) * 2.54) End Sub Private Sub nupp2_Click() txtTollid = Str(Val(txtSentimeetrid) / 2.54) End Sub Option Explicit Private Sub edasi_Click() ActiveCell.Offset(1, 0).Select aktiivneRidaVormi End Sub Private Sub nahtavaks_Click() Dim leht As Worksheet Set leht = Sheets("inimandmed") leht.Rows.Hidden = False End Sub Private Sub pnimeotsing_Click() Dim leht As Worksheet Dim rida As Range Dim reanr As Integer Set leht = Sheets("inimandmed") reanr = 1 Do While Len(Trim(leht.Cells(reanr, 1))) > 0 Set rida = leht.Rows(reanr) If txtPerekonnanimi.Text = leht.Cells(reanr, 2) Then rida.Hidden = False Else rida.Hidden = True End If reanr = reanr + 1 Loop End Sub Private Sub tagasi_Click() ActiveCell.Offset(-1, 0).Select aktiivneRidaVormi End Sub Sub aktiivneRidaVormi() Dim leht As Worksheet Dim reanr As Integer Set leht = Sheets("inimandmed") reanr = ActiveCell.Row txtEesnimi.Text = leht.Cells(reanr, 1) txtPerekonnanimi.Text = leht.Cells(reanr, 2) txtElektronpost.Text = leht.Cells(reanr, 3) txtPostiindeks.Text = leht.Cells(reanr, 4) End Sub Private Sub lisamisnupp_Click() Dim leht As Worksheet Dim inarv As Integer Set leht = Sheets("inimandmed") inarv = 1 Do While Len(Trim(leht.Cells(inarv, 1))) > 0 inarv = inarv + 1 Loop If Len(Trim(txtEesnimi)) = 0 Then MsgBox "eesnimi puudub" Exit Sub End If leht.Cells(inarv, 1) = txtEesnimi leht.Cells(inarv, 2) = txtPerekonnanimi leht.Cells(inarv, 3) = txtElektronpost leht.Cells(inarv, 4) = txtPostiindeks txtEesnimi = "" txtPerekonnanimi = "" txtElektronpost = "" txtPostiindeks = "" txtEesnimi.SetFocus End Sub Sub tekstifail1() Open "nimed.txt" For Append As #1 reanr = 1 Do While Len(Trim(Cells(reanr, 1))) > 0 Print #1, Cells(reanr, 1) reanr = reanr + 1 Loop Close #1 End Sub