Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Reverse sign

  Asked By: Joel    Date: Oct 15    Category: MS Office    Views: 615
  

I have a positive number in a cell, and want to change it's sign so
that it is a negative number, and I can't seem to find a way to do it.

Share: 

 

5 Answers Found

 
Answer #1    Answered By: Zachary Bouchard     Answered On: Oct 15

multiply by negative  one........

 
Answer #2    Answered By: Fadiyah Khan     Answered On: Oct 15

Not exactly sure how you're attempting to do this.
with VBA, or is just something you need once.
For a column? or just a single cell?

the answer that was given as: "multiply by -1" works.
in VBA, you could just use: Cell(2,1) = -1 * cell(2,1)
If the number  is already negative  though, it will reverse  the sign.
To ensure it will always result in a negative number,
try: Cell(2,1) = -1 * abs(cell(2,1))

 
Answer #3    Answered By: Billie Young     Answered On: Oct 15

You don't need the multiplication, just the negation.

Cell(2,1) = -Cell(2,1)

 
Answer #4    Answered By: Friso Bakker     Answered On: Oct 15

perhaps you don't know *where* to
put the code in order to get the code to execute in order to sign  to
change.

You can put the code inside the SelectionChange (or the Change)
event that belongs to the sheet the data is in. Then, when a number
is entered and the Enter key pushed, this Sub will fire and the sign
can be changed with the code.

In the VB editor, select the sheet, then select Worksheet in the
left Object PullDown on the top left. The followinag should appear
automatically. If it does not, select it in the upper right Procedure
PullDown.

Option Explicit
.................................................
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
' Put the sign change  code here
End Sub
.............................................

 
Answer #5    Answered By: Ula Hashmi     Answered On: Oct 15

=(A1) - (A1*2)..............................

 
Didn't find what you were looking for? Find more on Reverse sign Or get search suggestion and latest updates.




Tagged: