REPLACE or ??, Help please
Yup, that's what I get for copy/pasting ...
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 = TRUE ' *********** NOTE EDIT
End Sub
|