Google Map – Calculate Distance

Sub CalculateAllDistances()
Dim X1 As Double
Dim Y1 As Double
Dim X2 As Double
Dim Y2 As Double

Dim Distance As Double
For i = 2 To 4
    X1 = Cells(i, 1).Value
    Y1 = Cells(i, 2).Value
    For j = i + 1 To 5
        X2 = Cells(j, 1).Value
        Y2 = Cells(j, 2).Value
        'Calculate Distance between Cell1 (X1,Y1) and Cell2(X2,Y2)
        Distance = Sqr((Y2 - Y1) ^ 2 + (X2 - X1) ^ 2)
    Next j
Next i
End Sub

Why do you need to study maths well? https://stackoverflow.com/questions/30688423/calculating-the-distances-between-all-point-xy-on-a-plot-with-macros-vba-in?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa