Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 202
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing color of negative bar when using Invert if negative Breck Charts and Charting in Excel 9 March 4th 08 12:40 PM
change the colour of the "invert if negative" option in Excel Luci Charts and Charting in Excel 1 May 10th 07 01:48 PM
Change negative sign from end of number to the beginning of the number. GORDON SCALES via OfficeKB.com Excel Programming 3 January 30th 05 08:05 AM
2003= negative number&2004= negative number How Do I Calculate gro Jason Excel Worksheet Functions 1 January 14th 05 05:24 PM
Compare/match positve number against negative number? Kobayashi[_55_] Excel Programming 1 November 18th 04 02:47 PM


All times are GMT +1. The time now is 12:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"