I'm having trouble calculating multiple distances for different sets of points.
I can make the code to calculate a single distance between 2 points but I cannot make the program to calculate multiple points with a single click. If anyone can help, that would be great. This is what I have so far to calculate a single distance for 2 points.
Private Sub cmdDistCalc_Click()
Dim Ax, Ay, Bx, By As Double
Dim dist As Double
Ax = Cells(2, 1)
Ay = Cells(2, 2)
Bx = Cells(2, 3)
By = Cells(2, 4)
dist = ((Ax - Bx) ^ 2 + (Ay - By) ^ 2) ^ 0.5
Cells(2, 5) = dist
End Sub
I will attach the file as well as I have more questions in it.
Thank you.
Bookmarks