'将以度分秒表示的经纬度转换为以度表示的经纬度 Function CoordinateTrans(ByVal Coordinate As String) As Double Dim sTemp() As String '判断引用值是否为数值,若不是则直接输出0 If IsNumeric(Coordinate) Then '格式化经纬度的表示方法(度.分.秒) Coordinate = Format(Coordinate,"0.00.0000") '分解出“度”、“分”、“秒” sTemp = Split(Coordinate,".") '计算出以度表示的经纬度 CoordinateTrans = CDbl(Format(sTemp(0) + sTemp(1)/60 + sTemp(2)/600000,"0.000000000000") Else CoordinateTrans = 0 End If End Function