Remove specific text from a column of cells

S

Sweepea

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.
 
D

Don Guillett

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.
 
B

Biff

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
 
C

Carole O

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

Carole O
 
G

Gary''s Student

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
 
Top