ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem with a a number ending in - (https://www.excelbanter.com/excel-programming/399999-problem-number-ending.html)

jln via OfficeKB.com

Problem with a a number ending in -
 
Ok a system that i work with outputs a neg number like this 100-. So the
problem is this, since the system does this it make that number text. What i
need is if - show up i need to some how move it to the first spot so that it
can be viewed as a number and not text.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200710/1


joel

Problem with a a number ending in -
 
=IF(RIGHT(A1,1)="-",-1 * VALUE(LEFT(A1,LEN(A1)-1)),A1)

"jln via OfficeKB.com" wrote:

Ok a system that i work with outputs a neg number like this 100-. So the
problem is this, since the system does this it make that number text. What i
need is if - show up i need to some how move it to the first spot so that it
can be viewed as a number and not text.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200710/1



Tom Ogilvy

Problem with a a number ending in -
 
Select your range and run this macro:

Sub changeCells()
Dim r As Range, cell As Range
On Error Resume Next
Set r = Intersect(Selection.SpecialCells(xlConstants, xlTextValues),
Selection)
On Error GoTo 0
If Not r Is Nothing Then
For Each cell In r
If Right(cell, 1) = "-" Then
cell.Value = CDbl(cell.Value)
End If
Next
End If
End Sub

--
Regards,
Tom Ogilvy


"jln via OfficeKB.com" wrote:

Ok a system that i work with outputs a neg number like this 100-. So the
problem is this, since the system does this it make that number text. What i
need is if - show up i need to some how move it to the first spot so that it
can be viewed as a number and not text.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200710/1




All times are GMT +1. The time now is 10:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com