Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub CommandButton1_Click()
- Dim PeTable(1 To 5, 1 To 3) As Double
- Dim i As Double
- Dim p As Double
- Dim y As Integer
- Dim ImperviousRatio As Double
- Dim ImperviousLength As Double
- Dim PerviousRatio As Double
- Dim PerviousLength As Double
- Dim ContribLength As Double
- ImperviousLength = Trim(CInt(Cells(34, 19)))
- PerviousLength = Trim(CInt(Cells(36, 19)))
- ContribLength = Trim(CInt(Cells(38, 19)))
- ImperviousRatio = PerviousLength / ImperviousLength
- PerviousRatio = PerviousLength / ContribLength
- PeTable(1, 1) = 0.2
- PeTable(2, 1) = 0.4
- PeTable(3, 1) = 0.6
- PeTable(4, 1) = 0.8
- PeTable(5, 1) = 1
- PeTable(1, 2) = 0.1
- PeTable(2, 2) = 0.2
- PeTable(3, 2) = 0.3
- PeTable(4, 2) = 0.4
- PeTable(5, 2) = 0.5
- PeTable(1, 3) = 0.2
- PeTable(2, 3) = 0.4
- PeTable(3, 3) = 0.6
- PeTable(4, 3) = 0.8
- PeTable(5, 3) = 1
- For y = 1 To 5
- If (ImperviousRatio <= PeTable(y, 1)) Then
- i = Trim(PeTable(y, 3))
- End If
- Next y
- For y = 1 To 5
- If (PerviousRatio <= PeTable(y, 2)) Then
- p = Trim(PeTable(y, 3))
- End If
- Next y
- If (i <= p) Then
- Range("N48").Value = i
- End If
- If (p <= i) Then
- Range("N48").Value = p
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement