Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default trim left of a found word in a text variable

Mouthful ain't it!
Basically I have a text variable which can be of any length but includes the
phrase "Trf To". I want to modify the text by trimming all character to the
left of the phrase.

MervB
:-)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 634
Default trim left of a found word in a text variable

=MID(A1,SEARCH("Trf To",A1),LEN(A1))

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------*------------------------------*----------------
It's easier to beg forgiveness than ask permission :-)
------------------------------*------------------------------*----------------


"MervB" wrote in message
...
Mouthful ain't it!
Basically I have a text variable which can be of any length but includes
the
phrase "Trf To". I want to modify the text by trimming all character to
the
left of the phrase.

MervB
:-)



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default trim left of a found word in a text variable

Thanks Mate

"Ken Wright" wrote:

=MID(A1,SEARCH("Trf To",A1),LEN(A1))

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------Â*------------------------------Â*----------------
It's easier to beg forgiveness than ask permission :-)
------------------------------Â*------------------------------Â*----------------


"MervB" wrote in message
...
Mouthful ain't it!
Basically I have a text variable which can be of any length but includes
the
phrase "Trf To". I want to modify the text by trimming all character to
the
left of the phrase.

MervB
:-)




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 634
Default trim left of a found word in a text variable

You're welcome :-)

"MervB" wrote in message
...
Thanks Mate

"Ken Wright" wrote:

=MID(A1,SEARCH("Trf To",A1),LEN(A1))

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------*------------------------------*----------------
It's easier to beg forgiveness than ask permission :-)
------------------------------*------------------------------*----------------


"MervB" wrote in message
...
Mouthful ain't it!
Basically I have a text variable which can be of any length but
includes
the
phrase "Trf To". I want to modify the text by trimming all character to
the
left of the phrase.

MervB
:-)






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default trim left of a found word in a text variable

Ken,

Slight problem - my excel cant locate the search function

MervB
:-)

"Ken Wright" wrote:

You're welcome :-)

"MervB" wrote in message
...
Thanks Mate

"Ken Wright" wrote:

=MID(A1,SEARCH("Trf To",A1),LEN(A1))

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------Â*------------------------------Â*----------------
It's easier to beg forgiveness than ask permission :-)
------------------------------Â*------------------------------Â*----------------


"MervB" wrote in message
...
Mouthful ain't it!
Basically I have a text variable which can be of any length but
includes
the
phrase "Trf To". I want to modify the text by trimming all character to
the
left of the phrase.

MervB
:-)








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default trim left of a found word in a text variable

Ken,
Based on your input, I believe I've solved it:

Dim MyString As String
MyString = Range("D5") ' MyString = "Transfer the income trf to kim books 26
oct"
MyString = Mid(MyString, InStr(MyString, "trf to"), Len(MyString))
MsgBox (MyString)

Thanks
:-)


"MervB" wrote:

Ken,

Slight problem - my excel cant locate the search function

MervB
:-)

"Ken Wright" wrote:

You're welcome :-)

"MervB" wrote in message
...
Thanks Mate

"Ken Wright" wrote:

=MID(A1,SEARCH("Trf To",A1),LEN(A1))

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------Â*------------------------------Â*----------------
It's easier to beg forgiveness than ask permission :-)
------------------------------Â*------------------------------Â*----------------


"MervB" wrote in message
...
Mouthful ain't it!
Basically I have a text variable which can be of any length but
includes
the
phrase "Trf To". I want to modify the text by trimming all character to
the
left of the phrase.

MervB
:-)






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 634
Default trim left of a found word in a text variable

Sorry, didn't realise you were using VBA. I know it's the Programming
group, but with the data given the answer was available without the use of
VBA. Glad you got sorted though :-)

Regards
Ken.................

"MervB" wrote in message
...
Ken,
Based on your input, I believe I've solved it:

Dim MyString As String
MyString = Range("D5") ' MyString = "Transfer the income trf to kim books
26
oct"
MyString = Mid(MyString, InStr(MyString, "trf to"), Len(MyString))
MsgBox (MyString)

Thanks
:-)


"MervB" wrote:

Ken,

Slight problem - my excel cant locate the search function

MervB
:-)

"Ken Wright" wrote:

You're welcome :-)

"MervB" wrote in message
...
Thanks Mate

"Ken Wright" wrote:

=MID(A1,SEARCH("Trf To",A1),LEN(A1))

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------*------------------------------*----------------
It's easier to beg forgiveness than ask permission :-)
------------------------------*------------------------------*----------------


"MervB" wrote in message
...
Mouthful ain't it!
Basically I have a text variable which can be of any length but
includes
the
phrase "Trf To". I want to modify the text by trimming all
character to
the
left of the phrase.

MervB
:-)








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
trim everything from left of first underscore in the text? Mitchell_Collen via OfficeKB.com Excel Worksheet Functions 4 July 28th 09 07:49 PM
TRIM, LEFT, RIGHT cware Excel Worksheet Functions 3 March 3rd 09 10:38 PM
left trim Finger Tips Excel Worksheet Functions 9 April 29th 07 02:40 AM
Trim Function - Error Library Not Found Doug[_11_] Excel Programming 5 June 30th 04 04:43 AM
Trim, Len, Left causing problem krisrajz Excel Programming 5 June 13th 04 02:52 AM


All times are GMT +1. The time now is 03:50 AM.

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"