ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Invert Negative number? (https://www.excelbanter.com/excel-programming/414004-invert-negative-number.html)

NateBuckley

Invert Negative number?
 
Hello I'm just wondering if there is a built-in VBA function that'll invert
negative numbers so for example: -654 becomes 654.

Thanks for any help thrown my way.

Nate

Bob Phillips

Invert Negative number?
 
ABS(num)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"NateBuckley" wrote in message
...
Hello I'm just wondering if there is a built-in VBA function that'll
invert
negative numbers so for example: -654 becomes 654.

Thanks for any help thrown my way.

Nate




dennis

Invert Negative number?
 
ABS

"NateBuckley" wrote:

Hello I'm just wondering if there is a built-in VBA function that'll invert
negative numbers so for example: -654 becomes 654.

Thanks for any help thrown my way.

Nate


Tom Hutchins

Invert Negative number?
 
How about the Absolute function? For example, if A1 = -654

=Abs(A1)

in another cell yields 654.

Hope this helps,

Hutch

"NateBuckley" wrote:

Hello I'm just wondering if there is a built-in VBA function that'll invert
negative numbers so for example: -654 becomes 654.

Thanks for any help thrown my way.

Nate


Gary''s Student

Invert Negative number?
 
x=-x
--
Gary''s Student - gsnu200794


"NateBuckley" wrote:

Hello I'm just wondering if there is a built-in VBA function that'll invert
negative numbers so for example: -654 becomes 654.

Thanks for any help thrown my way.

Nate


wolfman

Invert Negative number?
 
If by 'invert' you mean to negate negative numbers, use the ABS() function
then all conversions result in positive values. If you mean to swap positive
for negative (or vice versa) use the suggested x = -x or X = X*(-1). Hope
this helps




All times are GMT +1. The time now is 11:12 AM.

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