Delete Part of Cell?
You need to place the three spaces into the tested string. Not " a-"
but " a-"
This should work for you:
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
Next
|