Data export causing false minus signs

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
try

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top