Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default 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 ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default 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 ***

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default 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 ***
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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 ***





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default 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 ***




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
vlookup part of string... [email protected] Excel Discussion (Misc queries) 6 October 24th 08 01:30 AM
Search/Match/Find ANY part of string to ANY part of Cell Value TWhizTom Excel Worksheet Functions 0 July 21st 08 08:16 PM
Extract Part of String [email protected] Excel Worksheet Functions 1 June 9th 05 08:33 AM
Find a part of a string Peter Pantus Excel Programming 3 March 15th 05 09:03 PM
Remove part of string Erik Excel Programming 3 October 2nd 04 05:08 PM


All times are GMT +1. The time now is 06:42 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"