extracting part of string value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a string value that varies in length. The first 13 characters I am not interested in, but the last part I'm interested in extracting. Here is a data example

SCR0334535 @ 0.01µ
SCR0334535 @ 0.03µ
SCR0334535 @ 0.1µ
SCR0334535 @ 0.3µ
SCR0334535 @ 1µ
SCR0334535 @ 3µ
SCR0334535 @ 10µ
SCR0334535 @ 30µ
SCR0334535 @ 100µ

How can I get the last part (character 14 and onwards) assigned to a new variable

Thank you
 
Dr Schwartz,

Sub test()

s1 = "SCR0334535 @ 100µM"
s2 = Right(s1, Len(s1) - 13)

x = InStr(s1, " @ ") + 2
s3 = Right(s1, Len(s1) - x)

Debug.Print s2, s3

End Sub

If you don't know the length of the "first part", get as
described for "s3"

Regards,
Sandy
-----Original Message-----
I have a string value that varies in length. The first 13
characters I am not interested in, but the last part I'm
interested in extracting. Here is a data example:
 
Hi,
In one line
Sub test()
Dim strtemp
strtemp ="SCR0334535 @ 0.01µM"
Debug.Print Mid(strtemp, InStr(strtemp, "@") + 1)
End Sub

Regards,

Jean-Yves

Dr. Schwartz said:
I have a string value that varies in length. The first 13 characters I am
not interested in, but the last part I'm interested in extracting. Here is a
data example:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top