Data export causing false minus signs

M

Mike Saffer

Greetings all,

Maybe you've seen this one before. I'm exporting numbers from a database.
They always export as text. One report I recently worked on had minus
symbols after the number and I need to remove the false symbols. Not all
cells have them so "=right(" formula won't work.

Example.. All numbers are in A column, lets say, and the formula goes in
the B column.

1012.32
-1506.98
5032.56
3651.01-
-3562.54
7463.66-
6373.66

My desired result is a formla that would remove the last character in the
cell, but only if it's a " - ",

1012.32
-1506.98
5032.56
3651.01
-3562.54
7463.66
6373.66

Once again, thank you for all your help.
Mike
 
V

Vergel Adriano

How about something like this:

=IF(RIGHT(A1,1)="-", LEFT(A1, LEN(A1)-1), A1)
 
D

Don Guillett

try

Sub fixrightminussign()
For Each c In Selection
If Right(c, 1) = "-" Then c.Value = "-" & Left(c, Len(c) - 1)
Next c
End Sub
 
Top