Change variable value of -1 to 1

  • Thread starter Thread starter Les Stout
  • Start date Start date
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
 
myVar = Abs(myVar)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
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)
 
I have solved it with the following thanks you...

dteDiff = Abs(dteDiff)

Best regards,

Les Stout
 
Back
Top