MGumbrell
12-05-2005, 04:55 AM
You will have to forgive me, I have actually asked this before but have lost the answer.
I was given a very simple solution.
I have a number of negative numbers that I wish to change to positive.
Somethng must have changed to this forum since my last visit on 25th November 2005 as cannot access any of my old threads where I could have looked for the previous answer.
Thank you
Matt
shades
12-05-2005, 05:35 AM
Do you want to change the value in the cell itsel? Or will it work with an extra column?
For the second, use in cell B2:
=ABS(A2)
Then copy down.
reclusivemonkey
12-05-2005, 05:42 AM
I'm not sure if there is a formula for this but if your negative number is "x" then;
x - (x*2)
should work.
Edit: Sorry, I thought this was in Access (don't *think* ABS() is available in Access). ABS() is a better answer.
MGumbrell
12-05-2005, 11:47 PM
Thank you for your help. The change as suggested was intended to be in another cell.
Thanks, Matt
Having responded I realised that I hadn't asked the right question. What I should have asked was:-
How can I reverse the sign of a number i.e a negative number to a positive and a postive number to a negative.
Sorry for the confusion.
Matt
qafself
12-06-2005, 01:51 AM
If the value you want to change is in say cell A5, surely the simplest way must be to enter in the destination cell "=A5*-1". This can then be copied down the column
Ed
Brianwarnock
12-06-2005, 02:27 AM
Here are the 2 macros I posted last time.
The lady I wrote them for has her own macro menu with them on so to use the second just highlight the numbers, you can use shift or Ctrl with the mouse, then click on the macro
Brian
Sub revsign()
'Reverses the sign of all numeric fields on a worksheet
For Each c In ActiveSheet.UsedRange
If c.Value = " " Then GoTo cont
If c.Value = "" Then GoTo cont
If c.Value > -9999999 And c.Value < 99999999 Then
c.Value = c.Value * -1
End If
cont:
Next c
End Sub
Sub revsign2()
'Reverses the sign of all numeric fields in selected range
For Each c In ActiveWindow.RangeSelection
If c.Value = " " Then GoTo cont
If c.Value = "" Then GoTo cont
If c.Value > -9999999 And c.Value < 99999999 Then
c.Value = c.Value * -1
End If
cont:
Next c
End Sub
MGumbrell
12-07-2005, 02:51 AM
Thanks to all.
Regards, Matt