Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
epowell74
 
Posts: n/a
Default Function to reverse the sign of a cell

I'd like to see a function or a toolbar button that would allow you to
reverse the sign of numbers in a selection.

Thanks!

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...et.f unctions
  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

You could always use a macro and assign it to a new button on a toolbar:

Sub ChangeSigns()
Dim cell As Range
Application.ScreenUpdating = False
On Error GoTo NoRangeFound
For Each cell In Selection.SpecialCells(xlCellTypeConstants, 1)
cell.Value = cell.Value * -1
Next
Application.ScreenUpdating = True
Exit Sub
NoRangeFound:
MsgBox "No values found!"
Application.ScreenUpdating = True
End Sub

---
This will only change numerical constants, not formulas returning numerical
values.

HTH
Jason
Atlanta, GA

"epowell74" wrote:

I'd like to see a function or a toolbar button that would allow you to
reverse the sign of numbers in a selection.

Thanks!

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...et.f unctions

  #3   Report Post  
epowell74
 
Posts: n/a
Default

I was thinking this could be available more for novice users who don't know
how to create a macro. I think it would be nice to have a standard function
like SUM that users could use.

Thanks,
Emily

"Jason Morin" wrote:

You could always use a macro and assign it to a new button on a toolbar:

Sub ChangeSigns()
Dim cell As Range
Application.ScreenUpdating = False
On Error GoTo NoRangeFound
For Each cell In Selection.SpecialCells(xlCellTypeConstants, 1)
cell.Value = cell.Value * -1
Next
Application.ScreenUpdating = True
Exit Sub
NoRangeFound:
MsgBox "No values found!"
Application.ScreenUpdating = True
End Sub

---
This will only change numerical constants, not formulas returning numerical
values.

HTH
Jason
Atlanta, GA

"epowell74" wrote:

I'd like to see a function or a toolbar button that would allow you to
reverse the sign of numbers in a selection.

Thanks!

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...et.f unctions

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
How do I obtain the address of a cell using the vlookup function? Spock Excel Worksheet Functions 2 May 16th 05 06:35 PM
How do I find the contents of a cell using the "ADDRESS" function. sweeney Excel Worksheet Functions 2 April 5th 05 03:23 AM
Get current cell with VBA function vbphil Excel Worksheet Functions 5 April 4th 05 11:23 PM
Using the MAX function with "constant increment" cell references John Dwyer Excel Worksheet Functions 3 December 10th 04 03:37 PM
Function to return colour of formatted cell ExcelMonkey Excel Worksheet Functions 3 November 1st 04 05:54 PM


All times are GMT +1. The time now is 05:32 AM.

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"