AW: Luftlinie Berechnen
30.01.2021 21:58:41
volti
Hallo,
hier zwei Möglichkeiten des Aufrufs:
Code:
[Cc][+][-]
Sub EntfernungErmitteln()
' Einzelentfernung für die aktuelle Zeile
Dim tDist As DIST_STRUCT
With tDist
.Start = Cells(ActiveCell.Row, "A").Value
.Ziel = Cells(ActiveCell.Row, "B").Value
If .Start <> "" And .Ziel <> "" Then
GetDistance tDist
Cells(ActiveCell.Row, "C").Value = .LDist & " km"
End If
End With
End Sub
Sub EntfernungErmittelnViele()
' Liste ausfüllen
Dim tDist As DIST_STRUCT, iZeile As Integer
Dim WSh As Worksheet
Set WSh = ActiveSheet
For iZeile = 1 To WSh.Cells(Rows.Count, "A").End(xlUp).Row
With tDist
.Start = WSh.Cells(iZeile, "A").Value
.Ziel = WSh.Cells(iZeile, "B").Value
If .Start <> "" And .Ziel <> "" Then
GetDistance tDist
WSh.Cells(iZeile, "C").Value = .LDist & " km"
End If
End With
Next iZeile
End Sub
_________________________
viele Grüße aus Freigericht 😊
Karl-Heinz