I have found that it helps me to write my functions in real words --
test that both ltpB and ltqB are empty strings, if so then check to make
sure that ltpB is not equal to TopB AND ltqB is not greater than MaxQ.
You may want to nest the two functions much like you would do in an
Excel Function, first testing IF both ltpB and ltqB are not empty
strings then test for IF ltpB is not equal to TopB and ltqB is not
greater than Max Q do something.
Dim TopB As Single
Dim MaxQ As Single
MaxQ = 1
If ltpB <> "" And ltqB <> "" Then
If ltpB <> TopB And ltqB > MaxQ Then
DO SOMETHING
Else
DO SOMETHING ELSE
End If