You could just use a brutal application of logic:
I think that works, but it's getting late hereCode:Dim a As Single Dim b As Single Dim c As Single Dim d As Single a = Val(txtValueA.Text) b = Val(txtvalueB.Text) c = Val(txtValueC.Text) Select Case True Case a <> 0 And b <> 0 And c <> 0 d = (a + b + c) / 3 Case a <> 0 And b <> 0, a <> 0 And c <> 0, b <> 0 And c <> 0 d = (a + b + c) / 2 Case Else d = a Or b Or c End Select Debug.Print "Average: "; d![]()




Reply With Quote