Pull the last 3 numbers of a longer numebr

Pull the last 3 numbers of a longer numebr

AMN3161
Advocate Advocate
341 Views
2 Replies
Message 1 of 3

Pull the last 3 numbers of a longer numebr

AMN3161
Advocate
Advocate

I figure this is simple but not sure

 

Anyone have a code to take a number like this 524641-524 and to only pull the last 3 digits of it for use elsewhere?

0 Likes
Accepted solutions (1)
342 Views
2 Replies
Replies (2)
Message 2 of 3

JelteDeJong
Mentor
Mentor
Accepted solution

try something like this:

Dim number = "524641-524"

Dim numberParts = number.Split("-")

Dim firstPart = numberParts(0)
Dim secondPart = numberParts(1)

MsgBox(secondPart)

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 3 of 3

AMN3161
Advocate
Advocate

Thats a really handy command, thank you!

0 Likes