Use part of string

T

Tempy

Hello all, i have a string and need to extract the Supplier name.
"GR extract for SAS Automotive RSA (Pty) Ltd"
I need to remove the "GR extract for " as this is constant and the rest
is variable in length, dependant on the supplier name.
Could somebody please help me with some code.

Thanks for the help in advance

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
 
R

raymond.allan

A quick and dirty way is:

Cells.Replace What:="GR extract for ", Replacement:="", LookAt:=xlPart,
_
SearchOrder:=xlByRows, MatchCase:=True

HTH
Raymond
 
S

Stefi

Hi Tempy,

=SUBSTITUTE(A1;"GR extract for ";"")

supposed your original text is in cell A1.

Regards,
Stefi


„Tempy†ezt írta:
 
T

Tempy

Hi Stefi, danke, but as i am not a programme, could you please explain
how i would use as i have tried it by saying myValue = Substitute(A1,
"GR extract for ", "") and then i get an error message ?
I know you are in Germany, as the "," in South Africa is replaced by the
";" in germany.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
 
S

Stefi

Or, if you need the return value in a VBA variable, use it like
myValue = WorksheetFunction.Substitute(A1,"GR extract for ", "")

Stefi


„Bob Phillips†ezt írta:
 

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

Similar Threads

STRING MANIPULATION ! ! 5
STRING MANIPULATION !! 1
Protect file name 2
Get Part of String 1
PADDING STRINGS !!!!! 3
Delete then Concatenate 2
LOOPING THROUGH A 2-D STRING ARRAY !!! 1
Extract Key word 1

Top