Change variable value of -1 to 1

L

Les Stout

Hello all, could somebody please tell me how to do the above in my code,
i am subtracting two dates and get a - value and would like to remove
the minus. My variable is long.



Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
 
B

Bob Phillips

myVar = Abs(myVar)

--
HTH

Bob

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

Chip Pearson

Just multiply the value by -1 to switch signs:

V = V * -1

To ensure it is always negative, use

V = Abs(V) * -1


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 

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