Reversing sign

T

Tribeless

Is there anyway to highlight a column of numbers and change their sign
from negative to positive (while leaving the values unaltered)?

Thank you in advance
 
D

Don Guillett

try this
sub reversesign()
for each c in selection
if c>0 then
c.value="-"&c
else c.value=abs(c)
end if
next
end sub
 
J

Jerry W. Lewis

Another approach if all values are negative, would be to place -1 in an
empty cell, copy that cell, select the range to be reversed, and
Edit|Paste Special|Multiply.

Note that positive numbers will be changed to negative, and that empty
cells will be changed to zero.

Jerry
 
B

Bob Flanagan

Still another approach is to change all minus signs to nothing. Just
highlight the column and press Ctl-F. In the first input box type in a "-".
Leave the second box blank. Then change all.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel
 
A

Andy Pope

Hi Tribeless,

I may have misunderstood your requirement of "while leaving the values
unaltered", if so ignore this.

Although the solutions suggested by Don, Jerry and Bob will work they
will also change you original values.

Either use their approaches with a 'helper' column of data or use the
Custom Number format.

Cheers
Andy
 
Top