Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1.  
  2. Private Sub CommandButton1_Click()
  3.  
  4. Dim PeTable(1 To 5, 1 To 3) As Double
  5. Dim i As Double
  6. Dim p As Double
  7. Dim y As Integer
  8. Dim ImperviousRatio As Double
  9. Dim ImperviousLength As Double
  10. Dim PerviousRatio As Double
  11. Dim PerviousLength As Double
  12. Dim ContribLength As Double
  13.  
  14. ImperviousLength = Trim(CInt(Cells(34, 19)))
  15. PerviousLength = Trim(CInt(Cells(36, 19)))
  16. ContribLength = Trim(CInt(Cells(38, 19)))
  17.  
  18. ImperviousRatio = PerviousLength / ImperviousLength
  19. PerviousRatio = PerviousLength / ContribLength
  20.  
  21. PeTable(1, 1) = 0.2
  22. PeTable(2, 1) = 0.4
  23. PeTable(3, 1) = 0.6
  24. PeTable(4, 1) = 0.8
  25. PeTable(5, 1) = 1
  26. PeTable(1, 2) = 0.1
  27. PeTable(2, 2) = 0.2
  28. PeTable(3, 2) = 0.3
  29. PeTable(4, 2) = 0.4
  30. PeTable(5, 2) = 0.5
  31. PeTable(1, 3) = 0.2
  32. PeTable(2, 3) = 0.4
  33. PeTable(3, 3) = 0.6
  34. PeTable(4, 3) = 0.8
  35. PeTable(5, 3) = 1
  36.  
  37. For y = 1 To 5
  38. If (ImperviousRatio <= PeTable(y, 1)) Then
  39. i = Trim(PeTable(y, 3))
  40. End If
  41. Next y
  42.  
  43. For y = 1 To 5
  44. If (PerviousRatio <= PeTable(y, 2)) Then
  45. p = Trim(PeTable(y, 3))
  46. End If
  47. Next y
  48.  
  49. If (i <= p) Then
  50. Range("N48").Value = i
  51. End If
  52.  
  53. If (p <= i) Then
  54. Range("N48").Value = p
  55. End If
  56.  
  57. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement