VBAで緯度と経度を度に変換しようとしています。列全体を度に上書きするサブルーチンを書きたいと思います。列全体を反復処理したいのですが、現在のセルに対してのみ機能します。オフセットを使用してセルを移動しました。しかし、助けにはなりません
Sub autoConvertToDegree()
Dim sign As Integer
Dim position As Integer
Dim temp As String
Dim tok As Variant
Do
sign = 0
position = 0
tok = Null
temp = ActiveCell.Value
sign = IIf(Left(temp, 1) = "-", -1, 1)
position = InStr(temp, "+")
If (position > 0) Then Mid(temp, position) = " "
position = InStr(temp, "-")
If (position > 0) Then Mid(temp, position) = " "
temp = Replace(temp, "'", " ")
temp = Replace(temp, """", " ")
temp = LTrim(temp)
tok = Split(temp, " ")
ActiveCell.Value = sign * (tok(0) + tok(1) / 60# + tok(2) / 3600#)
ActiveCell.Offset(1, 0).Select
Loop While Application.IsText(ActiveCell.Value)
End Sub