Function DistGPS(ByVal GPS1 As String, ByVal GPS2 As String) As Double
Dim TSpl1() As String, TSpl2 As String
TSpl1 = Split(GPS1, ",")
TSpl2 = Split(GPS2, ",")
DistGPS = DistGéo(Val(TSpl1(0)), Val(TSpl1(1)), Val(TSpl2(0)), Val(TSpl2(1)))
End Function
Function DistGéo(ByVal Lat1#, ByVal Lon1#, ByVal Lat2#, ByVal Lon2#) As Double
Const RayTerre = 6371, Pi = 245850922 / 78256779
Lat1 = Lat1 * Pi / 180: Lon1 = Lon1 * Pi / 180: Lat2 = Lat2 * Pi / 180: Lon2 = Lon2 * Pi / 180
DistGéo = RayTerre * (Pi / 2 - ASin(Sin(Lat2) * Sin(Lat1) + Cos(Lon2 - Lon1)) * Cos(Lat2) * Cos(Lat1))
End Function