REPLACE or ??, Help please
You could use code. The below is set to use the current selection as
its target range, but you could use a static range or the entire used
range.
Sub TruncCells()
Dim c As Range, i As Integer
Application.ScreenUpdating = False
For Each c In Selection
If Not c.HasFormula Then
i = InStr(1, c.Value, "-")
If i 0 Then c.Value = Left(c.Value, i - 1)
End If
Next c
Application.ScreenUpdating = False
End Sub
|