Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Find string in Data

Is it possible to find a string of data within a cell and extract the
next two words when it appears?

I have a large amount of text within column A for approximately 1000
lines. In column B onwards (dependent upon how many unique entries
there are) I want to pull out the next two words after "This has been
assigned to". This text may appear more than once, therefore the
second entry should be put in column C etc. etc...

I could do this for one entry using =FIND function however I'm not
sure how to do this for multiple entries and also pull out the next
two words as it's people's names so won't be a specific set of
characters.

Thanks in advance for your help with this.

Regards, Al.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Find string in Data

That sounds very possible but for something like this it would be really
helpful to see a string of data.

Mike

" wrote:

Is it possible to find a string of data within a cell and extract the
next two words when it appears?

I have a large amount of text within column A for approximately 1000
lines. In column B onwards (dependent upon how many unique entries
there are) I want to pull out the next two words after "This has been
assigned to". This text may appear more than once, therefore the
second entry should be put in column C etc. etc...

I could do this for one entry using =FIND function however I'm not
sure how to do this for multiple entries and also pull out the next
two words as it's people's names so won't be a specific set of
characters.

Thanks in advance for your help with this.

Regards, Al.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Find string in Data

Hi Mike,

Please see below. Hope this helps and many thanks for your help with
this.

Cheers, Al.

A1:
08/03/2007 14:03:32 m215039 Email Sent to Melanie.H CC:
BCC: Subject: Direct, Case ID:0000029967 Message: Hi Mel, just to
confirm, we did have a problem cancelling in the system (see my note
below to Technical team). PO7500079598 has now been cancelled for
you by Dave Williams. Kind regards Gill 08.03.07- tried to
cancel order PO7500079598 on behalf of Mel (see email request from
Mel) The Case has been Closed. Resolution Code: Updated By:
Gill Walker 08/03/2007 13:55:30 087063 Case Assigned to Gill
Walker Email Text: This case has been assigned to you, please view the
details below: The Assigned Individual has been changed to Gill
Walker Updated By: David W 08/03/2007 13:47:42 m215039 Case
Assigned to David W Email Text: This case has been assigned to you,
please view the details below: The Assigned Individual has been
changed to David Williams

On 26 Jun, 20:25, Mike H wrote:
That sounds very possible but for something like this it would be really
helpful to see a string of data.

Mike



" wrote:
Is it possible to find a string of data within a cell and extract the
next two words when it appears?


I have a large amount of text within column A for approximately 1000
lines. In column B onwards (dependent upon how many unique entries
there are) I want to pull out the next two words after "This has been
assigned to". This text may appear more than once, therefore the
second entry should be put in column C etc. etc...


I could do this for one entry using =FIND function however I'm not
sure how to do this for multiple entries and also pull out the next
two words as it's people's names so won't be a specific set of
characters.


Thanks in advance for your help with this.


Regards, Al.- Hide quoted text -


- Show quoted text -



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Find string in Data

Me again

there are) I want to pull out the next two words after "This has been
assigned to". This text may appear more than once, therefore the
second entry should be put in column C etc. etc...


Baffled as to why my formula didn't work until i discovered (Should have
checked first) the string you wanted to find doesn't exist in the text :)

Please clarify

Mike
" wrote:

Hi Mike,

Please see below. Hope this helps and many thanks for your help with
this.

Cheers, Al.

A1:
08/03/2007 14:03:32 m215039 Email Sent to Melanie.H CC:
BCC: Subject: Direct, Case ID:0000029967 Message: Hi Mel, just to
confirm, we did have a problem cancelling in the system (see my note
below to Technical team). PO7500079598 has now been cancelled for
you by Dave Williams. Kind regards Gill 08.03.07- tried to
cancel order PO7500079598 on behalf of Mel (see email request from
Mel) The Case has been Closed. Resolution Code: Updated By:
Gill Walker 08/03/2007 13:55:30 087063 Case Assigned to Gill
Walker Email Text: This case has been assigned to you, please view the
details below: The Assigned Individual has been changed to Gill
Walker Updated By: David W 08/03/2007 13:47:42 m215039 Case
Assigned to David W Email Text: This case has been assigned to you,
please view the details below: The Assigned Individual has been
changed to David Williams

On 26 Jun, 20:25, Mike H wrote:
That sounds very possible but for something like this it would be really
helpful to see a string of data.

Mike



" wrote:
Is it possible to find a string of data within a cell and extract the
next two words when it appears?


I have a large amount of text within column A for approximately 1000
lines. In column B onwards (dependent upon how many unique entries


I could do this for one entry using =FIND function however I'm not
sure how to do this for multiple entries and also pull out the next
two words as it's people's names so won't be a specific set of
characters.


Thanks in advance for your help with this.


Regards, Al.- Hide quoted text -


- Show quoted text -




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Find string in Data

Hi Mike,

Apologies, my attention to detail was not on the ball tonight. The
proper text is "The Assigned Individual has been changed to".

Thanks and apologies, should have checked this before posting.

Al.

On 26 Jun, 20:58, Mike H wrote:
Me again

there are) I want to pull out the next two words after "This has been
assigned to". This text may appear more than once, therefore the
second entry should be put in column C etc. etc...


Baffled as to why my formula didn't work until i discovered (Should have
checked first) the string you wanted to find doesn't exist in the text :)

Please clarify

Mike



" wrote:
Hi Mike,


Please see below. Hope this helps and many thanks for your help with
this.


Cheers, Al.


A1:
08/03/2007 14:03:32 m215039 Email Sent to Melanie.H CC:
BCC: Subject: Direct, Case ID:0000029967 Message: Hi Mel, just to
confirm, we did have a problem cancelling in the system (see my note
below to Technical team). PO7500079598 has now been cancelled for
you by Dave Williams. Kind regards Gill 08.03.07- tried to
cancel order PO7500079598 on behalf of Mel (see email request from
Mel) The Case has been Closed. Resolution Code: Updated By:
Gill Walker 08/03/2007 13:55:30 087063 Case Assigned to Gill
Walker Email Text: This case has been assigned to you, please view the
details below: The Assigned Individual has been changed to Gill
Walker Updated By: David W 08/03/2007 13:47:42 m215039 Case
Assigned to David W Email Text: This case has been assigned to you,
please view the details below: The Assigned Individual has been
changed to David Williams


On 26 Jun, 20:25, Mike H wrote:
That sounds very possible but for something like this it would be really
helpful to see a string of data.


Mike


" wrote:
Is it possible to find a string of data within a cell and extract the
next two words when it appears?


I have a large amount of text within column A for approximately 1000
lines. In column B onwards (dependent upon how many unique entries


I could do this for one entry using =FIND function however I'm not
sure how to do this for multiple entries and also pull out the next
two words as it's people's names so won't be a specific set of
characters.


Thanks in advance for your help with this.


Regards, Al.- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Find string in Data

I think you can use this subroutine on a per row basis...

Sub GetAssignments(Cell As Range, Phrase As String)
Dim X As Long
Dim Fields() As String
Dim Words() As String
Fields = Split(Replace(Range("A1").Text, vbLf, " "), Phrase)
For X = 1 To UBound(Fields)
Words = Split(Trim$(Fields(X)), " ")
Cell.Offset(0, X).Value = Words(0) & " " & Words(1)
Next
End Sub

For your given example, this call....

GetAssignments Range("A1"), "The Assigned Individual has been changed to"

will place the name Gil Rogers in B1 and David Walker in C1. In your code,
simply set up a loop through all the cells in your data column that have
data in them and, on each loop, pass in the cell address and your
find-phrase.

Rick


wrote in message
ups.com...
Hi Mike,

Apologies, my attention to detail was not on the ball tonight. The
proper text is "The Assigned Individual has been changed to".

Thanks and apologies, should have checked this before posting.

Al.

On 26 Jun, 20:58, Mike H wrote:
Me again

there are) I want to pull out the next two words after "This has
been
assigned to". This text may appear more than once, therefore the
second entry should be put in column C etc. etc...


Baffled as to why my formula didn't work until i discovered (Should have
checked first) the string you wanted to find doesn't exist in the text :)

Please clarify

Mike



" wrote:
Hi Mike,


Please see below. Hope this helps and many thanks for your help with
this.


Cheers, Al.


A1:
08/03/2007 14:03:32 m215039 Email Sent to Melanie.H CC:
BCC: Subject: Direct, Case ID:0000029967 Message: Hi Mel, just to
confirm, we did have a problem cancelling in the system (see my note
below to Technical team). PO7500079598 has now been cancelled for
you by Dave Williams. Kind regards Gill 08.03.07- tried to
cancel order PO7500079598 on behalf of Mel (see email request from
Mel) The Case has been Closed. Resolution Code: Updated By:
Gill Walker 08/03/2007 13:55:30 087063 Case Assigned to Gill
Walker Email Text: This case has been assigned to you, please view the
details below: The Assigned Individual has been changed to Gill
Walker Updated By: David W 08/03/2007 13:47:42 m215039 Case
Assigned to David W Email Text: This case has been assigned to you,
please view the details below: The Assigned Individual has been
changed to David Williams


On 26 Jun, 20:25, Mike H wrote:
That sounds very possible but for something like this it would be
really
helpful to see a string of data.


Mike


" wrote:
Is it possible to find a string of data within a cell and extract
the
next two words when it appears?


I have a large amount of text within column A for approximately
1000
lines. In column B onwards (dependent upon how many unique entries


I could do this for one entry using =FIND function however I'm not
sure how to do this for multiple entries and also pull out the next
two words as it's people's names so won't be a specific set of
characters.


Thanks in advance for your help with this.


Regards, Al.- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -




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
find string data type related functions clara Excel Programming 2 May 26th 07 12:33 PM
find mid value of string data in data with integers Maxi[_2_] Excel Programming 2 August 8th 06 05:01 PM
Macro to find text string in a column and paste data in another nicolascap Excel Discussion (Misc queries) 8 March 14th 06 03:13 PM
Find Data in a String Bill Excel Programming 3 May 17th 04 10:10 PM
Wish to parse through a text string to find data Neil Bhandar[_2_] Excel Programming 2 October 24th 03 07:04 PM


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