Here's a simple VBA function to check if the point (x, y) is on a line with slope m and y-intercept b:
Ideally, you want the value of Difference in the function to be 0, but in practice, you may get rounding errors, which is why I put in Abs(Difference) < 0.0000000001, which is 1.0E-10. You may want to make this number larger or smaller, depending on the accuracy of the calculations of your values of x, y, m, and b.