View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default HELP I need a function or macro to crop cells

Sub BBB()
Dim s As String, iloc As Long
Dim iloc1 As Long
s = Range("A1").Value
iloc = InStr(1, s, " ", vbTextCompare)
iloc1 = InStr(iloc + 1, s, " ", vbTextCompare)
Range("A1") = Left(s, iloc) & Right(s, Len(s) - iloc1)

End Sub

--
Regards,
Tom Ogilvy


"Shani" wrote:

Example If cell A1= STEPHEN R WILSON
I would like A1=STEPHEN WILSON