ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Set Column Negative (https://www.excelbanter.com/excel-worksheet-functions/133581-set-column-negative.html)

Michael Laferriere

Set Column Negative
 
Hi Folks - I know how to convert positive numbers to negative. The multiply
by -1 works well if you have already entered the values. Is there a way to
force negative numbers in a specific column at the time of entry? Thanks.

--
Michael



Beege

Set Column Negative
 
Michael Laferriere wrote:
Hi Folks - I know how to convert positive numbers to negative. The multiply
by -1 works well if you have already entered the values. Is there a way to
force negative numbers in a specific column at the time of entry? Thanks.


Would you want to use validation where entry < 0?

Beege

Michael Laferriere

Set Column Negative
 
Beege - Not really ... I was just getting lazy, hoping there was way to
eliminate the need for me to type a negative sign.


Michael


"Beege" wrote in message
. ..
Michael Laferriere wrote:
Hi Folks - I know how to convert positive numbers to negative. The
multiply by -1 works well if you have already entered the values. Is
there a way to force negative numbers in a specific column at the time of
entry? Thanks.


Would you want to use validation where entry < 0?

Beege




vezerid

Set Column Negative
 
On Mar 6, 8:53 pm, "Michael Laferriere" wrote:
Hi Folks - I know how to convert positive numbers to negative. The multiply
by -1 works well if you have already entered the values. Is there a way to
force negative numbers in a specific column at the time of entry? Thanks.

--
Michael


Michael,
if you want all values in a certain column, say A:A, become negative,
you can use the following event procedu

Private Sub Worksheet_Change(ByVal Target As Range)
TargetCol = 1 'change column number here
If Target.Column = TargetCol Then
Target.Value = -Abs(Target.Value)
End If
End Sub

To install:
Right-click on the sheet-tab of the sheet in question. Choose View
COde. Paste the above code.

HTH
Kostis Vezerides



All times are GMT +1. The time now is 11:29 PM.

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