Advertisement
krabak

Untitled

Oct 20th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 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. Next
  21.  
  22. prumer = Math.Round(cteplota / 7, 2)
  23.  
  24. For radek = 2 To 65536
  25. If Cells(radek, 2) = "" Then
  26. PrvniPrazdnyRadek = radek
  27. Exit For
  28. End If
  29. Next
  30.  
  31. If teplota < Min Then
  32. minimum = teplota
  33. End If
  34. If teplota > Max Then
  35. maximum = teplota
  36. End If
  37.  
  38. Cells(radek, 2) = prumer
  39. Cells(radek, 3) = maximum
  40. Cells(radek, 4) = minimum
  41. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement