Negative numbers not recognized

  • Thread starter Thread starter Rick
  • Start date Start date
R

Rick

When I import reports into Excel, negative numbers are
shown as n- (ex: 100-)which Excel does not recognize as a
negative number.
How can these numbers (n-) be changed to -n?
 
If you numbers were in A1, in B1

=-LEFT(A1,LEN(A1)-1)

then drag fill down the column.

A Macro

Sub Cnvrt()
Dim cell As Range, sVal As String
For Each cell In Selection.SpecialCells( _
xlConstants, xlTextValues)
sVal = Trim(cell.Value)
If Right(sVal, 1) = "-" Then
cell.NumberFormat = "General"
cell.Value = CDbl(sVal)
End If
Next
End Sub
 
Back
Top