Bonjour a tous,
Voici le fichier Excel.
Colonnes 8 a 10, 17 et 18: format GPS en DMS, il y a une colonne latitude et longitude indique dans la feuille.
Colonnes 19 et 20: conversion DDM
colonnes 21 et 22 conversions en DD
Latitude: dd mm ss,ss N ou S et Longitude: ddd mm ss,ss E ou W.
Besoin d'etre guide pour le code VBA,
En vous remerciant
a+
Function Convert_Decimal(Degree_Deg As String) As Double
' Declare the variables to be double precision floating-point
Dim degrees As Double
Dim minutes As Double
Dim seconds As Double
' Set degree to value before "°" of Argument Passed.
Degree_Deg = Replace(Degree_Deg, "~", "°")
degrees = CDbl(Left(Degree_Deg, InStr(1, Degree_Deg, "°") - 1))
' Set minutes to the value between the "°" and the "'"
' of the text string for the variable Degree_Deg divided by
' 60. The Val function converts the text string to a number.
minutes = CDbl(Mid(Degree_Deg, InStr(1, Degree_Deg, "°") + 1, _
InStr(1, Degree_Deg, "'") - InStr(1, Degree_Deg, "°") - 1)) / 60
' Set seconds to the number to the right of "'" that is
' converted to a value and then divided by 3600.
seconds = CDbl(Mid(Degree_Deg, InStr(1, Degree_Deg, "'") + _
1, Len(Degree_Deg) - InStr(1, Degree_Deg, "'") - 1)) / 3600
Convert_Decimal = degrees + minutes + seconds
End Function