Advertisement
krabak

Untitled

Oct 20th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. Private Sub CommandButton1_Click()
  2. Worksheets("bingbong").Activate
  3. Dim teplota As Integer
  4. Rem Dim tyden As Byte
  5. Dim maximum As Integer
  6. Dim minimum As Integer
  7. Dim prumer As Double
  8. Dim cteplota As Integer
  9. Dim i As Byte
  10.  
  11. Rem tyden = InputBox("Zadej číslo týdne: ")
  12. maximum = -100
  13. minimum = 100
  14. prumer = 0
  15. cteplota = 0
  16.  
  17. For i = 1 To 7
  18. teplota = InputBox("Zadej teplotu " & i & ". dne")
  19. cteplota = cteplota + teplota
  20.  
  21. If i = 1 Then
  22. If teplota < Min Then
  23. minimum = teplota
  24. End If
  25. If teplota > Max Then
  26. maximum = teplota
  27. End If
  28. End If
  29. Next
  30.  
  31. prumer = Math.Round(cteplota / 7, 2)
  32.  
  33. For radek = 2 To 65536
  34. If Cells(radek, 2) = "" Then
  35. PrvniPrazdnyRadek = radek
  36. Exit For
  37. End If
  38. Next
  39.  
  40. Cells(radek, 2) = prumer
  41. Cells(radek, 3) = maximum
  42. Cells(radek, 4) = minimum
  43. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement