jbarbara11
09-06-2013, 02:09 PM
I cannot get past this. I am guessing there is a better approach?:banghead:
Sub test() Dim PG As String
Dim depth As String
Dim bottomtime As String
depth = 35
bottomtime = 44
Select Case PG
Case depth < 36 And bottomtime < 11 Or depth < 41 And bottomtime < 10 Or depth < 51 And bottomtime < 8 Or depth < 61 And bottomtime < 7 Or depth < 71 And bottomtime < 6 Or depth < 81 And bottomtime < 5 Or depth < 91 And bottomtime < 5 Or depth < 101 And bottomtime < 4 Or depth < 111 And bottomtime < 4 Or depth < 121 And bottomtime < 4 Or depth < 131 And bottomtime < 4
MsgBox "A"
Case depth < 36 And bottomtime < 20 Or depth < 41 And bottomtime < 17 Or depth < 51 And bottomtime < 14 Or depth < 61 And bottomtime < 12 Or depth < 71 And bottomtime < 10 Or depth < 81 And bottomtime < 9 Or depth < 91 And bottomtime < 8 Or depth < 101 And bottomtime < 7 Or depth < 111 And bottomtime < 7 Or depth < 121 And bottomtime < 6 Or depth < 131 And bottomtime < 6 Or depth < 141 And bottomtime < 5
MsgBox "B"
Case depth < 36 And bottomtime < 26 Or depth < 41 And bottomtime < 23 Or depth < 51 And bottomtime < 18 Or depth < 61 And bottomtime < 15 Or depth < 71 And bottomtime < 13 Or depth < 81 And bottomtime < 11 Or depth < 91 And bottomtime < 10 Or depth < 101 And bottomtime < 9 Or depth < 111 And bottomtime < 8 Or depth < 121 And bottomtime < 7 Or depth < 131 And bottomtime < 7 Or depth < 141 And bottomtime < 6
MsgBox "C"
Case depth < 36 And bottomtime < 30 Or depth < 41 And bottomtime < 26 Or depth < 51 And bottomtime < 20 Or depth < 61 And bottomtime < 17 Or depth < 71 And bottomtime < 14 Or depth < 81 And bottomtime < 12 Or depth < 91 And bottomtime < 11 Or depth < 101 And bottomtime < 10 Or depth < 111 And bottomtime < 9 Or depth < 121 And bottomtime < 8 Or depth < 131 And bottomtime < 8 Or depth < 141 And bottomtime < 7
MsgBox "D"
Case depth < 36 And bottomtime < 33 Or depth < 41 And bottomtime < 28 Or depth < 51 And bottomtime < 22 Or depth < 61 And bottomtime < 18 Or depth < 71 And bottomtime < 16 Or depth < 81 And bottomtime < 14 Or depth < 91 And bottomtime < 12 Or depth < 101 And bottomtime < 11 Or depth < 111 And bottomtime < 10 Or depth < 121 And bottomtime < 9 Or depth < 131 And bottomtime < -9998 Or depth < 141 And bottomtime < 8
MsgBox "E"
Case depth < 36 And bottomtime < 37 Or depth < 41 And bottomtime < 32 Or depth < 51 And bottomtime < 25 Or depth < 61 And bottomtime < 20 Or depth < 71 And bottomtime < 17 Or depth < 81 And bottomtime < 15 Or depth < 91 And bottomtime < 13 Or depth < 101 And bottomtime < 12 Or depth < 111 And bottomtime < 11 Or depth < 121 And bottomtime < 10 Or depth < 131 And bottomtime < 9 Or depth < 141 And bottomtime < 9
MsgBox "F"
Case depth < 36 And bottomtime < 41 Or depth < 41 And bottomtime < 35 Or depth < 51 And bottomtime < 27 Or depth < 61 And bottomtime < 22 Or depth < 71 And bottomtime < 19 Or depth < 81 And bottomtime < 16 Or depth < 91 And bottomtime < 14 Or depth < 101 And bottomtime < 13 Or depth < 111 And bottomtime < 12 Or depth < 121 And bottomtime < 11 Or depth < 131 And bottomtime < 10 Or depth < 141 And bottomtime
MsgBox "G"
Case depth < 36 And bottomtime < 45 Or depth < 41 And bottomtime < 38 Or depth < 51 And bottomtime < 29 Or depth < 61 And bottomtime < 24 Or depth < 71 And bottomtime < 20 Or depth < 81 And bottomtime < 18 Or depth < 91 And bottomtime < 16 Or depth < 101 And bottomtime < 14 Or depth < 111 And bottomtime < 13 Or depth < 121 And bottomtime < 12 Or depth < 131 And bottomtime < 11 Or depth < 141 And bottomtime
MsgBox "H"
Case depth < 36 And bottomtime < 49 Or depth < 41 And bottomtime < 41 Or depth < 51 And bottomtime < 32 Or depth < 61 And bottomtime < 26 Or depth < 71 And bottomtime < 22 Or depth < 81 And bottomtime < 19 Or depth < 91 And bottomtime < 17 Or depth < 101 And bottomtime < 15 Or depth < 111 And bottomtime < 14 Or depth < 121 And bottomtime < -9998 Or depth < 131 And bottomtime
MsgBox "I"
Case depth < 36 And bottomtime < 53 Or depth < 41 And bottomtime < 45 Or depth < 51 And bottomtime < 34 Or depth < 61 And bottomtime < 28 Or depth < 71 And bottomtime < 23 Or depth < 81 And bottomtime < 20 Or depth < 91 And bottomtime < 18 Or depth < 101 And bottomtime < 16 Or depth < 111 And bottomtime < -9998 Or depth < 121 And bottomtime < 13 Or depth < 131 And bottomtime
MsgBox "J"
Case depth < 36 And bottomtime < 58 Or depth < 41 And bottomtime < 49 Or depth < 51 And bottomtime < 37 Or depth < 61 And bottomtime < 30 Or depth < 71 And bottomtime < 25 Or depth < 81 And bottomtime < 22 Or depth < 91 And bottomtime < 19 Or depth < 101 And bottomtime < 17 Or depth < 111 And bottomtime < 15 Or depth < 121 And bottomtime < 14 Or depth < 131 And bottomtime
MsgBox "K"
Case depth < 36 And bottomtime < 63 Or depth < 41 And bottomtime < 52 Or depth < 51 And bottomtime < 40 Or depth < 61 And bottomtime < 32 Or depth < 71 And bottomtime < 27 Or depth < 81 And bottomtime < 23 Or depth < 91 And bottomtime < 20 Or depth < 101 And bottomtime < 18 Or depth < 111 And bottomtime < 16 Or depth < 121 And bottomtime
MsgBox "L"
Case depth < 36 And bottomtime < 68 Or depth < 41 And bottomtime < 56 Or depth < 51 And bottomtime < 42 Or depth < 61 And bottomtime < 34 Or depth < 71 And bottomtime < 28 Or depth < 81 And bottomtime < 24 Or depth < 91 And bottomtime < 22 Or depth < 101 And bottomtime < 19 Or depth < 111 And bottomtime < 17 Or depth < 121 And bottomtime
MsgBox "M"
Case depth < 36 And bottomtime < 74 Or depth < 41 And bottomtime < 61 Or depth < 51 And bottomtime < 45 Or depth < 61 And bottomtime < 36 Or depth < 71 And bottomtime < 30 Or depth < 81 And bottomtime < 26 Or depth < 91 And bottomtime < 23 Or depth < 101 And bottomtime < 20 Or depth < 111 And bottomtime
MsgBox "N"
Case depth < 36 And bottomtime < 80 Or depth < 41 And bottomtime < 65 Or depth < 51 And bottomtime < 48 Or depth < 61 And bottomtime < 38 Or depth < 71 And bottomtime < 32 Or depth < 81 And bottomtime < 27 Or depth < 91 And bottomtime < 24 Or depth < 101 And bottomtime < 21 Or depth < 111 And bottomtime
MsgBox "O"
Case depth < 36 And bottomtime < 86 Or depth < 41 And bottomtime < 70 Or depth < 51 And bottomtime < 51 Or depth < 61 And bottomtime < 40 Or depth < 71 And bottomtime < 34 Or depth < 81 And bottomtime < 29 Or depth < 91 And bottomtime < 25 Or depth < 101 And bottomtime
MsgBox "P"
Case depth < 36 And bottomtime < 93 Or depth < 41 And bottomtime < 75 Or depth < 51 And bottomtime < 54 Or depth < 61 And bottomtime < 43 Or depth < 71 And bottomtime < 36 Or depth < 81 And bottomtime < 30 Or depth < 91 And bottomtime < 26 Or depth < 101 And bottomtime
MsgBox "Q"
Case depth < 36 And bottomtime < 101 Or depth < 41 And bottomtime < 80 Or depth < 51 And bottomtime < 58 Or depth < 61 And bottomtime < 45 Or depth < 71 And bottomtime < 37 Or depth < 81 And bottomtime < 31 Or depth < 91 And bottomtime
MsgBox "R"
Case depth < 36 And bottomtime < 109 Or depth < 41 And bottomtime < 86 Or depth < 51 And bottomtime < 61 Or depth < 61 And bottomtime < 48 Or depth < 71 And bottomtime < 39 Or depth < 81 And bottomtime
MsgBox "S"
Case depth < 36 And bottomtime < 118 Or depth < 41 And bottomtime < 92 Or depth < 51 And bottomtime < 64 Or depth < 61 And bottomtime < 50 Or depth < 71 And bottomtime < 41 Or depth < 81 And bottomtime
MsgBox "T"
Case depth < 36 And bottomtime < 128 Or depth < 41 And bottomtime < 98 Or depth < 51 And bottomtime < 68 Or depth < 61 And bottomtime < 53 Or depth < 71 And bottomtime
MsgBox "U"
Case depth < 36 And bottomtime < 140 Or depth < 41 And bottomtime < 105 Or depth < 51 And bottomtime < 72 Or depth < 61 And bottomtime < 55 Or depth < 71 And bottomtime
MsgBox "V"
Case depth < 36 And bottomtime < 153 Or depth < 41 And bottomtime < 112 Or depth < 51 And bottomtime < 76 Or depth < 61 And bottomtime < 56 Or depth < 71 And bottomtime
MsgBox "W"
Case depth < 36 And bottomtime < 169 Or depth < 41 And bottomtime < 121 Or depth < 51 And bottomtime < 81 Or depth < 61 And bottomtime
MsgBox "X"
Case depth < 36 And bottomtime < 189 Or depth < 41 And bottomtime < 130 Or depth < 51 And bottomtime
MsgBox "Y"
Case depth < 36 And bottomtime < 206 Or depth < 41 And bottomtime < 141 Or depth < 51 And bottomtime
MsgBox "Z"
End Select
End Sub
Sub test() Dim PG As String
Dim depth As String
Dim bottomtime As String
depth = 35
bottomtime = 44
Select Case PG
Case depth < 36 And bottomtime < 11 Or depth < 41 And bottomtime < 10 Or depth < 51 And bottomtime < 8 Or depth < 61 And bottomtime < 7 Or depth < 71 And bottomtime < 6 Or depth < 81 And bottomtime < 5 Or depth < 91 And bottomtime < 5 Or depth < 101 And bottomtime < 4 Or depth < 111 And bottomtime < 4 Or depth < 121 And bottomtime < 4 Or depth < 131 And bottomtime < 4
MsgBox "A"
Case depth < 36 And bottomtime < 20 Or depth < 41 And bottomtime < 17 Or depth < 51 And bottomtime < 14 Or depth < 61 And bottomtime < 12 Or depth < 71 And bottomtime < 10 Or depth < 81 And bottomtime < 9 Or depth < 91 And bottomtime < 8 Or depth < 101 And bottomtime < 7 Or depth < 111 And bottomtime < 7 Or depth < 121 And bottomtime < 6 Or depth < 131 And bottomtime < 6 Or depth < 141 And bottomtime < 5
MsgBox "B"
Case depth < 36 And bottomtime < 26 Or depth < 41 And bottomtime < 23 Or depth < 51 And bottomtime < 18 Or depth < 61 And bottomtime < 15 Or depth < 71 And bottomtime < 13 Or depth < 81 And bottomtime < 11 Or depth < 91 And bottomtime < 10 Or depth < 101 And bottomtime < 9 Or depth < 111 And bottomtime < 8 Or depth < 121 And bottomtime < 7 Or depth < 131 And bottomtime < 7 Or depth < 141 And bottomtime < 6
MsgBox "C"
Case depth < 36 And bottomtime < 30 Or depth < 41 And bottomtime < 26 Or depth < 51 And bottomtime < 20 Or depth < 61 And bottomtime < 17 Or depth < 71 And bottomtime < 14 Or depth < 81 And bottomtime < 12 Or depth < 91 And bottomtime < 11 Or depth < 101 And bottomtime < 10 Or depth < 111 And bottomtime < 9 Or depth < 121 And bottomtime < 8 Or depth < 131 And bottomtime < 8 Or depth < 141 And bottomtime < 7
MsgBox "D"
Case depth < 36 And bottomtime < 33 Or depth < 41 And bottomtime < 28 Or depth < 51 And bottomtime < 22 Or depth < 61 And bottomtime < 18 Or depth < 71 And bottomtime < 16 Or depth < 81 And bottomtime < 14 Or depth < 91 And bottomtime < 12 Or depth < 101 And bottomtime < 11 Or depth < 111 And bottomtime < 10 Or depth < 121 And bottomtime < 9 Or depth < 131 And bottomtime < -9998 Or depth < 141 And bottomtime < 8
MsgBox "E"
Case depth < 36 And bottomtime < 37 Or depth < 41 And bottomtime < 32 Or depth < 51 And bottomtime < 25 Or depth < 61 And bottomtime < 20 Or depth < 71 And bottomtime < 17 Or depth < 81 And bottomtime < 15 Or depth < 91 And bottomtime < 13 Or depth < 101 And bottomtime < 12 Or depth < 111 And bottomtime < 11 Or depth < 121 And bottomtime < 10 Or depth < 131 And bottomtime < 9 Or depth < 141 And bottomtime < 9
MsgBox "F"
Case depth < 36 And bottomtime < 41 Or depth < 41 And bottomtime < 35 Or depth < 51 And bottomtime < 27 Or depth < 61 And bottomtime < 22 Or depth < 71 And bottomtime < 19 Or depth < 81 And bottomtime < 16 Or depth < 91 And bottomtime < 14 Or depth < 101 And bottomtime < 13 Or depth < 111 And bottomtime < 12 Or depth < 121 And bottomtime < 11 Or depth < 131 And bottomtime < 10 Or depth < 141 And bottomtime
MsgBox "G"
Case depth < 36 And bottomtime < 45 Or depth < 41 And bottomtime < 38 Or depth < 51 And bottomtime < 29 Or depth < 61 And bottomtime < 24 Or depth < 71 And bottomtime < 20 Or depth < 81 And bottomtime < 18 Or depth < 91 And bottomtime < 16 Or depth < 101 And bottomtime < 14 Or depth < 111 And bottomtime < 13 Or depth < 121 And bottomtime < 12 Or depth < 131 And bottomtime < 11 Or depth < 141 And bottomtime
MsgBox "H"
Case depth < 36 And bottomtime < 49 Or depth < 41 And bottomtime < 41 Or depth < 51 And bottomtime < 32 Or depth < 61 And bottomtime < 26 Or depth < 71 And bottomtime < 22 Or depth < 81 And bottomtime < 19 Or depth < 91 And bottomtime < 17 Or depth < 101 And bottomtime < 15 Or depth < 111 And bottomtime < 14 Or depth < 121 And bottomtime < -9998 Or depth < 131 And bottomtime
MsgBox "I"
Case depth < 36 And bottomtime < 53 Or depth < 41 And bottomtime < 45 Or depth < 51 And bottomtime < 34 Or depth < 61 And bottomtime < 28 Or depth < 71 And bottomtime < 23 Or depth < 81 And bottomtime < 20 Or depth < 91 And bottomtime < 18 Or depth < 101 And bottomtime < 16 Or depth < 111 And bottomtime < -9998 Or depth < 121 And bottomtime < 13 Or depth < 131 And bottomtime
MsgBox "J"
Case depth < 36 And bottomtime < 58 Or depth < 41 And bottomtime < 49 Or depth < 51 And bottomtime < 37 Or depth < 61 And bottomtime < 30 Or depth < 71 And bottomtime < 25 Or depth < 81 And bottomtime < 22 Or depth < 91 And bottomtime < 19 Or depth < 101 And bottomtime < 17 Or depth < 111 And bottomtime < 15 Or depth < 121 And bottomtime < 14 Or depth < 131 And bottomtime
MsgBox "K"
Case depth < 36 And bottomtime < 63 Or depth < 41 And bottomtime < 52 Or depth < 51 And bottomtime < 40 Or depth < 61 And bottomtime < 32 Or depth < 71 And bottomtime < 27 Or depth < 81 And bottomtime < 23 Or depth < 91 And bottomtime < 20 Or depth < 101 And bottomtime < 18 Or depth < 111 And bottomtime < 16 Or depth < 121 And bottomtime
MsgBox "L"
Case depth < 36 And bottomtime < 68 Or depth < 41 And bottomtime < 56 Or depth < 51 And bottomtime < 42 Or depth < 61 And bottomtime < 34 Or depth < 71 And bottomtime < 28 Or depth < 81 And bottomtime < 24 Or depth < 91 And bottomtime < 22 Or depth < 101 And bottomtime < 19 Or depth < 111 And bottomtime < 17 Or depth < 121 And bottomtime
MsgBox "M"
Case depth < 36 And bottomtime < 74 Or depth < 41 And bottomtime < 61 Or depth < 51 And bottomtime < 45 Or depth < 61 And bottomtime < 36 Or depth < 71 And bottomtime < 30 Or depth < 81 And bottomtime < 26 Or depth < 91 And bottomtime < 23 Or depth < 101 And bottomtime < 20 Or depth < 111 And bottomtime
MsgBox "N"
Case depth < 36 And bottomtime < 80 Or depth < 41 And bottomtime < 65 Or depth < 51 And bottomtime < 48 Or depth < 61 And bottomtime < 38 Or depth < 71 And bottomtime < 32 Or depth < 81 And bottomtime < 27 Or depth < 91 And bottomtime < 24 Or depth < 101 And bottomtime < 21 Or depth < 111 And bottomtime
MsgBox "O"
Case depth < 36 And bottomtime < 86 Or depth < 41 And bottomtime < 70 Or depth < 51 And bottomtime < 51 Or depth < 61 And bottomtime < 40 Or depth < 71 And bottomtime < 34 Or depth < 81 And bottomtime < 29 Or depth < 91 And bottomtime < 25 Or depth < 101 And bottomtime
MsgBox "P"
Case depth < 36 And bottomtime < 93 Or depth < 41 And bottomtime < 75 Or depth < 51 And bottomtime < 54 Or depth < 61 And bottomtime < 43 Or depth < 71 And bottomtime < 36 Or depth < 81 And bottomtime < 30 Or depth < 91 And bottomtime < 26 Or depth < 101 And bottomtime
MsgBox "Q"
Case depth < 36 And bottomtime < 101 Or depth < 41 And bottomtime < 80 Or depth < 51 And bottomtime < 58 Or depth < 61 And bottomtime < 45 Or depth < 71 And bottomtime < 37 Or depth < 81 And bottomtime < 31 Or depth < 91 And bottomtime
MsgBox "R"
Case depth < 36 And bottomtime < 109 Or depth < 41 And bottomtime < 86 Or depth < 51 And bottomtime < 61 Or depth < 61 And bottomtime < 48 Or depth < 71 And bottomtime < 39 Or depth < 81 And bottomtime
MsgBox "S"
Case depth < 36 And bottomtime < 118 Or depth < 41 And bottomtime < 92 Or depth < 51 And bottomtime < 64 Or depth < 61 And bottomtime < 50 Or depth < 71 And bottomtime < 41 Or depth < 81 And bottomtime
MsgBox "T"
Case depth < 36 And bottomtime < 128 Or depth < 41 And bottomtime < 98 Or depth < 51 And bottomtime < 68 Or depth < 61 And bottomtime < 53 Or depth < 71 And bottomtime
MsgBox "U"
Case depth < 36 And bottomtime < 140 Or depth < 41 And bottomtime < 105 Or depth < 51 And bottomtime < 72 Or depth < 61 And bottomtime < 55 Or depth < 71 And bottomtime
MsgBox "V"
Case depth < 36 And bottomtime < 153 Or depth < 41 And bottomtime < 112 Or depth < 51 And bottomtime < 76 Or depth < 61 And bottomtime < 56 Or depth < 71 And bottomtime
MsgBox "W"
Case depth < 36 And bottomtime < 169 Or depth < 41 And bottomtime < 121 Or depth < 51 And bottomtime < 81 Or depth < 61 And bottomtime
MsgBox "X"
Case depth < 36 And bottomtime < 189 Or depth < 41 And bottomtime < 130 Or depth < 51 And bottomtime
MsgBox "Y"
Case depth < 36 And bottomtime < 206 Or depth < 41 And bottomtime < 141 Or depth < 51 And bottomtime
MsgBox "Z"
End Select
End Sub