03.05.2017, 11:38
Hallo zusammen,
ich bin dabei mir einen Code zu basteln. Hier wäre es toll, wenn es möglich ist, die Entfernung zweier Adressen in Zeile A1 einzufügen. Ich scheiter jedoch daran, dass ich nicht weiß, wie der wert "Entfernung" in Zelle A1 übergeben wird.
soweit bin ich bisher:
Sub x()
Dim IEApp As Object, i As Long
Set IEApp = CreateObject("InternetExplorer.Application")
IEApp.Visible = True
With Sheets("Tabelle1")
For i = 1 To 1
MsgBox i
.Cells(i, 3).Value = Entfernungtest(IEApp, .Cells(i, 1).Value, .Cells(i, 2).Value)
Next i
End with
'IEApp.Quit
'Set IEApp = Nothing
End Sub
Function Entfernungtest(IEApp As Object, ByVal Von As String, ByVal bis As String) As String
Dim arText As Variant
Dim i As Long
str_VON = "Neuss"
str_NACH = "Kaarst"
IEApp.Navigate "http://maps.google.com/maps?saddr=" & str_VON & "&daddr=" & str_NACH & "&hl=de"
End Function
ich bin dabei mir einen Code zu basteln. Hier wäre es toll, wenn es möglich ist, die Entfernung zweier Adressen in Zeile A1 einzufügen. Ich scheiter jedoch daran, dass ich nicht weiß, wie der wert "Entfernung" in Zelle A1 übergeben wird.
soweit bin ich bisher:
Sub x()
Dim IEApp As Object, i As Long
Set IEApp = CreateObject("InternetExplorer.Application")
IEApp.Visible = True
With Sheets("Tabelle1")
For i = 1 To 1
MsgBox i
.Cells(i, 3).Value = Entfernungtest(IEApp, .Cells(i, 1).Value, .Cells(i, 2).Value)
Next i
End with
'IEApp.Quit
'Set IEApp = Nothing
End Sub
Function Entfernungtest(IEApp As Object, ByVal Von As String, ByVal bis As String) As String
Dim arText As Variant
Dim i As Long
str_VON = "Neuss"
str_NACH = "Kaarst"
IEApp.Navigate "http://maps.google.com/maps?saddr=" & str_VON & "&daddr=" & str_NACH & "&hl=de"
End Function