View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
E Oveson[_3_] E Oveson[_3_] is offline
external usenet poster
 
Posts: 12
Default Extract date from right to left in a cell

Looks like there's already some answers here, but I'll throw mine out there
for you also (paste into a module and use it as a function in the workbook):

Function RIGHTWORD(rng As Range)

If rng.Cells.Count 1 Then RIGHTWORD = CVErr(xlErrValue)

If IsEmpty(rng.Value) Then RIGHTWORD = ""

RIGHTWORD = Right(rng.Value, Len(rng.Value) - InStrRev(rng.Value, " "))

End Function

-erik

"jh" wrote in message
om...
I have an excel spreadsheet containing numerous cells. I need to
extract the right most word in each cell. The lengths and number of
spaces vary between cells, so I need a function that will read from
right to left until a space is encountered. Any help will be greatly
appreciated.

J