View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
just_jon
 
Posts: n/a
Default 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