home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 1999 April / PCW0499.ISO / sharewar / PRX / p04pcw.EXE / P04pcw.bas
Encoding:
BASIC Source File  |  1999-01-05  |  1.0 KB  |  42 lines

  1. Attribute VB_Name = "Modul1"
  2. Sub lernen()
  3. For i = 1 To Worksheets.Count
  4.     Sheets(i).Activate
  5.     Columns("B:B").Hidden = True
  6. Next
  7. anzahl = InputBox("Geben Sie die Anzahl der Wiederholungen an!")
  8. r = 0
  9. f = 0
  10. For i = 1 To anzahl
  11.     a = zufall
  12.     Range(a).Select
  13.     deutsch = InputBox("Geben Sie die ▄bersetzung von '" & Range(a) & "' ein!")
  14.     If deutsch = ActiveCell.Offset(0, 1) Then
  15.     MsgBox ("Richtig!")
  16.     r = r + 1
  17.     Else
  18.     MsgBox ("Falsch!, Richtig wΣre '" & ActiveCell.Offset(0, 1) & "' gewesen")
  19.     f = f + 1
  20.     End If
  21. Next
  22. MsgBox ("Sie haben " & r & " richtige und " & f & " falsche Antworten gegeben.")
  23. For i = 1 To Worksheets.Count
  24.     Sheets(i).Activate
  25.     Columns("B:B").Hidden = False
  26. Next
  27.  
  28. End Sub
  29.  
  30. Function zufall()
  31. Tabellenzahl = Worksheets.Count
  32. Blatt = Int(Tabellenzahl * Rnd + 1)
  33. Worksheets(Blatt).Activate
  34. Set tabelle = ActiveCell.CurrentRegion
  35. Zeilenzahl = tabelle.Rows.Count
  36. Zeile = Int(Zeilenzahl * Rnd + 1)
  37. zufall = "A" & Zeile
  38. End Function
  39.  
  40.  
  41.  
  42.