ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing the sign of cell using a macro (https://www.excelbanter.com/excel-programming/277807-changing-sign-cell-using-macro.html)

Jason Knauff

Changing the sign of cell using a macro
 
Does anyone have a macro written that will change the sign
(from positive to negative or negative to positive) of a
number in a cell in excel? Or, does MSFT already have a
keyboard shortcut for this operation? Please help.

Dan E[_2_]

Changing the sign of cell using a macro
 
Jason,

Here's one that'll change the signs of all selected cells

Sub ChangeSign()
For Each c In Selection
c.Value = -c.Value
Next
End Sub

Dan E

"Jason Knauff" wrote in message ...
Does anyone have a macro written that will change the sign
(from positive to negative or negative to positive) of a
number in a cell in excel? Or, does MSFT already have a
keyboard shortcut for this operation? Please help.




Dan E[_2_]

Changing the sign of cell using a macro
 
Shoulda mentioned,

DONT USE THIS ON CELLS CONTAINING FORMULAS

Dan E

"Dan E" wrote in message ...
Jason,

Here's one that'll change the signs of all selected cells

Sub ChangeSign()
For Each c In Selection
c.Value = -c.Value
Next
End Sub

Dan E

"Jason Knauff" wrote in message ...
Does anyone have a macro written that will change the sign
(from positive to negative or negative to positive) of a
number in a cell in excel? Or, does MSFT already have a
keyboard shortcut for this operation? Please help.






Jason Knauff

Changing the sign of cell using a macro
 
Thanx a million.
Any idea why MSFT dosen't have a keyboard shortcut for
this one already?

jasonK.

-----Original Message-----
Shoulda mentioned,

DONT USE THIS ON CELLS CONTAINING FORMULAS

Dan E

"Dan E" wrote in

message ...
Jason,

Here's one that'll change the signs of all selected

cells

Sub ChangeSign()
For Each c In Selection
c.Value = -c.Value
Next
End Sub

Dan E

"Jason Knauff" wrote in

message ...
Does anyone have a macro written that will change the

sign
(from positive to negative or negative to positive)

of a
number in a cell in excel? Or, does MSFT already have

a
keyboard shortcut for this operation? Please help.





.


Chip Pearson

Changing the sign of cell using a macro
 
Jason,

Enter -1 in some cell. Copy that cell. Then select the cells whose signs
you want to change. Then go to the Edit menu Choose Paste Special, and
choose the Multiply option.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com

"Jason Knauff" wrote in message
...
Does anyone have a macro written that will change the sign
(from positive to negative or negative to positive) of a
number in a cell in excel? Or, does MSFT already have a
keyboard shortcut for this operation? Please help.





All times are GMT +1. The time now is 09:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com