ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Use part of string (https://www.excelbanter.com/excel-programming/340578-use-part-string.html)

Tempy

Use part of string
 
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 ***

[email protected]

Use part of string
 
A quick and dirty way is:

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

HTH
Raymond


Stefi

Use part of string
 
Hi Tempy,

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

supposed your original text is in cell A1.

Regards,
Stefi


€˛Tempy€¯ ezt Ć*rta:

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 ***


Tempy

Use part of string
 
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 ***

Bob Phillips[_6_]

Use part of string
 
Stefi's is a worksheet formula, just plug it into the sheet.

--
HTH

Bob Phillips

"Tempy" wrote in message
...
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 ***




Stefi

Use part of string
 
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:

Stefi's is a worksheet formula, just plug it into the sheet.

--
HTH

Bob Phillips

"Tempy" wrote in message
...
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 ***






All times are GMT +1. The time now is 05:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com