Change the sign of a cell
Solved
papyjlsn
Posted messages
8
Status
Member
-
COUET -
COUET -
Hello,
I would like to be able to change the + sign to - by clicking a button on the value it contains
For example, cell x = 930 click button and cell x = -930
I haven't found the VBA macro.
I am open to a solution
Thank you
I would like to be able to change the + sign to - by clicking a button on the value it contains
For example, cell x = 930 click button and cell x = -930
I haven't found the VBA macro.
I am open to a solution
Thank you
6 answers
-
Hello,
even simpler (this comes from Microsoft support):
1. Enter the number -1 in an empty cell of the spreadsheet
2. Select that cell
3. In the Edit menu, choose the Copy command
4. Select the range of cells whose sign you want to reverse
5. In the Edit menu, choose the Paste Special command
6. Select Paste Values and Multiplication Operation
7. Click OK
See you soon
Eric -
```vb Sub InverserSigne()
Dim cel As Range
For Each cel In Selection
If cel.Value = "" Then
Else
If IsNumeric(cel) Then
cel.Value = cel.Value * -1
End If
End If
Next
End Sub
this code changes the sign of one or more selected cell(s) ``` -
Thank you for this quick response.
This macro works perfectly.
It is now integrated into my club management program, which now contains around 45 macros. -
-
Merging macros, I don't know how to do it.
However, I don't quite understand, as each one has its own function and they are created in the Visual Basic editor folder which is itself integrated into my Excel program.
Thanks anyway for the info. -
I think the simplest solution is Kgigan's, which consists of a VBA macro that I run by pressing a button.
It also works for one or more selected cells.
Thank you for your response, though.
Papyjlsn