Sub DMSToLocation(N As String,E As String) As Double()
Dim data1,data2 As String
data1 = N
data2 = E
Dim type1,type2 As String
type1 = data1.SubString(data1.Length-1).ToLowerCase
type2 = data2.SubString(data1.Length-1).ToLowerCase
Dim n1 As String = data1.SubString2(0,2)
Dim n2 As String = data1.SubString2(2,data1.Length-1)
Dim e1 As String = data2.SubString2(0,2)
Dim e2 As String = data2.SubString2(2,data2.Length-1)
Dim lat As Double
Dim lon As Double
If type1 = "n" Then
lat = NumberFormat(n1 + (n2/60),0,5)
End If
If type2 = "e" Then
lon = NumberFormat(e1 + (e2/60),0,5)
End If
If type1 = "s" Then
n2 = n2 * -1
lat = NumberFormat(n1 + (n2/60),0,5)
End If
If type2 = "w" Then
e2 = e2 * -1
lon = NumberFormat(e1 + (e2/60),0,5)
End If
Return Array As Double(lat,lon)
End Sub