问题 I am trying to implement Haversine formula into excel function. Its looks like this: Public Function Haversine(Lat1 As Variant, Lon1 As Variant, Lat2 As Variant, Lon2 As Variant) Dim R As Integer, dlon As Variant, dlat As Variant, Rad1 As Variant Dim a As Variant, c As Variant, d As Variant, Rad2 As Variant R = 6371 dlon = Excel.WorksheetFunction.Radians(Lon2 - Lon1) dlat = Excel.WorksheetFunction.Radians(Lat2 - Lat1) Rad1 = Excel.WorksheetFunction.Radians(Lat1) Rad2 = Excel.WorksheetFunction