Remove specific text from a column of cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Example:

Apple and Pear Oct 2,2006
Orange and Lime Oct 30,2006
Pear and Pineapple Oct 6, 2006

I want to remove the date at the end of each cell. Can someone help? Thank
you.
 
One TOO simple way would be to have a helper column
=left(a2,len(a2)-11)
Leaves a space on the single digit but probably doesn't matter.
 
Based on your samples the date appears after the 3rd space. If that's
consistent within your data:

=LEFT(A1,FIND("~",SUBSTITUTE(A1," ","~",3))-1)

Biff
 
Try Edit, Replace, and in Find What type in Oct * Then click on Replace
or Replace All at the bottom.

Carole O
 
My previous posting will only remove Oct data. If the text has an aribtrary
number of words and the date is always the last three words in the cell then
this little UDF will remove then:

Function sweepea(s As String) As String
ss = Split(s, " ")
For i = 0 To UBound(ss) - 3
sweepea = sweepea & ss(i) & " "
Next
End Function
 
Back
Top