Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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: SCR0334535 @ 0.01µM SCR0334535 @ 0.03µM SCR0334535 @ 0.1µM SCR0334535 @ 0.3µM SCR0334535 @ 1µM SCR0334535 @ 3µM SCR0334535 @ 10µM SCR0334535 @ 30µM SCR0334535 @ 100µM How can I get the last part (character 14 and onwards) assigned to a new variable? Thank you . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Sandy, just what I needed
|
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in 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: SCR0334535 @ 0.01µM SCR0334535 @ 0.03µM SCR0334535 @ 0.1µM SCR0334535 @ 0.3µM SCR0334535 @ 1µM SCR0334535 @ 3µM SCR0334535 @ 10µM SCR0334535 @ 30µM SCR0334535 @ 100µM How can I get the last part (character 14 and onwards) assigned to a new variable? Thank you |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Extracting part of a cell | Excel Worksheet Functions | |||
Search/Match/Find ANY part of string to ANY part of Cell Value | Excel Worksheet Functions | |||
Extracting part of data | Excel Discussion (Misc queries) | |||
Extracting part of a cell | Excel Worksheet Functions | |||
Extracting Part of a Date | Excel Discussion (Misc queries) |