GET value between parentheses

User avatar
sal21
PlatinumLounger
Posts: 4354
Joined: 26 Apr 2010, 17:36

GET value between parentheses

Post by sal21 »

...
ALBANIA-(AL)
ALGERIA-(DZ)
ANDORRA-(AD)
ANGOLA-(AO)
ANGUILLA-(AI)
ANTARTIDE-(AQ)
ANTIGUA E BARBUDA-(AG)
ANTILLE OLANDESI-(AN)
ARABIA SAUDITA-(SA)
...

how to get the value between parentesys and store it in SIGLA?

note:
the length of state is variable

User avatar
HansV
Administrator
Posts: 78457
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: GET value between parentesys

Post by HansV »

Let's say you have the full text in a variable named NAZIONE.

SIGLA = Mid(NAZIONE, Len(NAZIONE) - 2, 2)
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4354
Joined: 26 Apr 2010, 17:36

Re: GET value between parentesys

Post by sal21 »

HansV wrote:
16 Oct 2022, 11:02
Let's say you have the full text in a variable named NAZIONE.

SIGLA = Mid(NAZIONE, Len(NAZIONE) - 2, 2)
:clapping: