Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default extracting part of string value

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default extracting part of string value

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default extracting part of string value

Thanks Sandy, just what I needed
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default extracting part of string value

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting part of a cell Colin Hayes Excel Worksheet Functions 2 August 5th 09 12:09 PM
Search/Match/Find ANY part of string to ANY part of Cell Value TWhizTom Excel Worksheet Functions 0 July 21st 08 08:16 PM
Extracting part of data Himani Excel Discussion (Misc queries) 4 June 3rd 08 11:48 PM
Extracting part of a cell [email protected] Excel Worksheet Functions 6 May 22nd 08 01:11 AM
Extracting Part of a Date GLT Excel Discussion (Misc queries) 2 November 23rd 05 12:04 AM


All times are GMT +1. The time now is 04:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"