View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
DShaw DShaw is offline
external usenet poster
 
Posts: 4
Default Matching CELL text (full word) to full word in string in anot

Thanks Gary but I should have mentioned that there are middle initials and
sometimes a & for two first names ie. Jake & Jackie L Peters
Thats why I was hoping to match Peters find the end charector count on
Peters and trim to the left to the begining of the cell.

Dan


"Gary''s Student" wrote:

Enter:


Sub gsnu()
Dim s As String
Dim r As Range
For Each r In Selection
s2 = Split(r.Value, " ")
u = UBound(s2)
s3 = s2(2)
For i = 3 To u
s3 = s3 & " " & s2(i)
Next
r.Value = s3
Next

End Sub

If you select cells in column C and run the macro it will remove the first
two words in the cell.
--
Gary''s Student


"DShaw" wrote:

I am not the greatest at programig this is what I have.

I recieved a data files with COLUMB A [ FISRT NAME] COLUMB B [LAST NAME]
now columb c is suppose to have just the address but it has the first and
last name in it as well. See below.

example:
COLUMB A | COLUMB B COLUMBC
-----------------------------------------------------------------------------------
John |Smith | John Smith 123 loveless drive Cville ST 12345

I would like to use COLUMB B "last name" find the string in COLUMB C and
trim from the charector count it finds from the end of the last name to the
begining of the cell. Can anyone help.
Thank you in advance.

Dan