Firstly, it looks like you can move the last two lines
y = (Val(awt1_lbl.Text) + Val(awt2_lbl.Text) + Val(awt3_lbl.Text)) / 3 awt_ans.Text = y
outside if-then-else , because they do the same in all six cases.
Further, since your code assigns Val (0) to the element with the smallest key a+b to the value in the middle and a to the largest, you can put a , b and c in the awt1_lbl , awt2_lb and awt3_lbl array into the value array and sort them as follows way:
Dim keys() As String = { a, b, c } Dim labels() As LabelType = { awt1_lbl, awt2_lb, awt3_lbl }
source share