... and assign to the fisrt item to LAT end second value to LNG
in my case:
LAT=40.49523
LNG=16.455915
note:
- LAT and LNG are String dimensioned
- the lenght of item between parenthesis are variable
how to get separate value in string between parenthesis
-
- PlatinumLounger
- Posts: 4311
- Joined: 26 Apr 2010, 17:36
how to get separate value in string between parenthesis
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 77584
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: how to get separate value in string between parenthesis
Code: Select all
Dim p1 As Long
Dim p2 As Long
Dim v As String
Dim a() As String
p1 = InStr(STRADE, "(")
p2 = InStr(p1 + 1, STRADE, ")")
v = Mid(STRADE, p1 + 1, p2 - p1 - 1)
a = Split(v, "-")
LAT = a(0)
LNG = a(1)
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4311
- Joined: 26 Apr 2010, 17:36
Re: how to get separate value in string between parenthesis
HansV wrote: ↑25 Jun 2022, 17:22Code: Select all
Dim p1 As Long Dim p2 As Long Dim v As String Dim a() As String p1 = InStr(STRADE, "(") p2 = InStr(p1 + 1, STRADE, ")") v = Mid(STRADE, p1 + 1, p2 - p1 - 1) a = Split(v, "-") LAT = a(0) LNG = a(1)
