I have an assignment for my engineering class in which I must write a VBA program that finds the middle number of three numbers. My program compiles, but it returns 0 each time. I am not sure what I am doing wrong. Here is the code:
Option Explicit Function FINDMID(a, b, c) Dim x As Single, y As Single If a > b Then a = x Else b = x End If If x < c Then x = y Else c = y End If FINDMID = y End Function
Bookmarks