Invert Negative number?

N

NateBuckley

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
 
B

Bob Phillips

ABS(num)

--
HTH

Bob

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

Tom Hutchins

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

=Abs(A1)

in another cell yields 654.

Hope this helps,

Hutch
 
W

wolfman

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
 

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

Top