Je crois surtout, au vu de votre réaction, que vous n'avez pas envie d'aider les gens qui posent des questions sur ce forum.
Si votre action consiste à balancer des liens Internet, n'importe qui peut aller sur Google pour ça.
Donc comme je ne suis pas un fainéant comme vous vous permettez de le penser, je me suis creusé la tête et je suis arriver au résultat voulu, à savoir:
Sub dectomin()
With Range("e:f")
.NumberFormat = "0.000000"
.Value = .Value
End With
Dim POSIT As String
L = 2
While Cells(L, 5) <> ""
If IsNumeric(Cells(L, 5).Value) And IsNumeric(Cells(L, 6).Value) Then
Cells(L, 13).Value = DectoMinN(Cells(L, 5).Value) & "/" & DectoMinW(Cells(L, 6).Value)
L = L + 1
Else
Rows(L).Delete
End If
Wend
End Sub
Public Function DectoMinN(ByVal LAT As Double) As String
lat1 = Int(Math.Abs(LAT))
LAT2 = Math.Round(((Math.Abs(LAT) - lat1) * 60), 0)
If LAT2 = 60 Then
lat1 = lat1 + 1
LAT2 = 0
End If
slat = Replace(ajustlong(Replace(Str(lat1), " ", ""), 2) & ajustlong(Replace(Str(LAT2), " ", ""), 2), " ", "")
If LAT >= 0 Then
slat = slat & "N"
Else
slat = slat & "S"
End If
DectoMinN = slat
End Function
Public Function DectoMinW(ByVal lon As Double) As String
Dim lon1, lon2 As Double
Dim slon As String
lon1 = Int(Math.Abs(lon))
lon2 = Math.Round(((Math.Abs(lon) - lon1) * 60), 0)
If lon2 = 60 Then
lon1 = lon1 + 1
lon2 = 0
End If
slon = Replace(ajustlong(Replace(Str(lon1), " ", ""), 3) & ajustlong(Replace(Str(lon2), " ", ""), 2), " ", "")
If lon >= 0 Then
slon = slon & "E"
Else
slon = slon & "W"
End If
DectoMinW = slon
End Function
Public Function MintoDecN(ByVal LAT As String) As Double
If Left(LAT, 5) Like "####[A-Z]" Then
MintoDecN = Val(Left(LAT, 2)) + (Val(Mid(LAT, 3, 2)) / 60)
If UCase(Mid(LAT, 5, 1)) = "S" Then
MintoDecN = -MintoDecN
End If
Else
MintoDecN = 0
End If
End Function
Public Function MintoDecW(ByVal lon As String) As Double
If Left(lon, 6) Like "#####[A-Z]" Then
MintoDecW = Val(Left(lon, 3)) + (Val(Mid(lon, 4, 2)) / 60)
If UCase(Mid(lon, 6, 1)) = "W" Then
MintoDecW = -MintoDecW
End If
Else
MintoDecW = 0
End If
End Function
Public Function ajustlong(ByVal chaine As String, ByVal long1 As Integer) As String
Dim t As Integer
If Len(chaine) < long1 Then
For t = Len(chaine) + 1 To long1
chaine = Str(0) & chaine
Next
End If
ajustlong = chaine
End Function
Je vous remercie quand même pour avoir au moins répondu à mon mail.
J'espère que cette macro servira à d'autres.
Cordialement