View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ramthebuffs[_9_] Ramthebuffs[_9_] is offline
external usenet poster
 
Posts: 1
Default Delete Part of Cell?


Maybe somebody can help with my very similar problem. I'm trying t
remove the left part of a cell and have tried to adjust the above code
but can't get it to work.

On some of my cells it begins with a- or b- with 3 spaces before this
So its <space<space<spacea-

Here is what I tried. Any thoughts

For Each cell In Range("team1batting!A2:A25")
If cell.Value = "" Then Exit Sub
sStr = Trim(cell.Value)
If Left(sStr, 3) = " a-" Or Left(sStr, 3) = " b-" Then
cell.Value = Trim(Right(sStr, Len(sStr) - 5))
End If
Nex

--
Ramthebuff
-----------------------------------------------------------------------
Ramthebuffs's Profile: http://www.excelforum.com/member.php...fo&userid=1642
View this thread: http://www.excelforum.com/showthread.php?threadid=27412