Hey there,
I dont know if I understand everything correctly.
- The coordinates are only seperated by " "(space)? Example: (7.187345 9.247461)
- You want to split it in to separete cells? Example: A1 = 7.187345 / B1 = 9.247461
If this is correct, the following should work
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Dim varray As Variant
For Each Rng In WorkRng
varray = Split(Rng.Value, " ")
Rng.Value = varray(0)
Rng.Offset(0, 1).Value = varray(1)
For i = 0 To 1
num1 = Rng.Offset(0, i).Value
num2 = (num1 - Int(num1)) * 60
num3 = Format((num2 - Int(num2)) * 60, "00")
Rng.Offset(0, i).Value = Int(num1) & "°" & Int(num2) & "'" & Int(num3) & "''"
Next i
Next
End Sub
.
Bookmarks