Hi,
In Excel 2003, all I want my macro to do is look at two adjacent numbers and evaluate them according to a maximum and a minimum. If either is below or above the min and max respectively, it must return "...has not met measured parameters" and vice versa. If any one of a pair of numbers is not in the min-max range, it can disregard all other numbers. Sounds pretty simple so I'm sure there's something small I'm missing.
Here's the code:
Sub Roofbolter_evaluation()
Dim Result As String
For n = 1 To 5
Min = Range("D6").Offset(n).Value
Max = Range("E6").Offset(n).Value
If Min < Range("B6").Offset(n).Value < Max _
And Min < Range("C6").Offset(n).Value < Max Then
Result = "Roofbolter has met measured parameters"
Else
Result = "Roofbolter has not met measured parameters"
Exit For
End If
Next n
Range("A48").Value = Result
End Sub
Thanks
Bookmarks