Home |
Search |
Today's Posts |
#2
![]() |
|||
|
|||
![]()
Hooking the Change event will do it.
First, create a named range called "MyNegativeRange" Then right-click the worksheet tab and select View Code. Paste this code. Private Sub Worksheet_Change(ByVal Target As Range) Const cNegRangeName = "MyNegativeRange" Dim rngTarget As Range, rng As Range Set rngTarget = Intersect(Target, Range(cNegRangeName)) If Not rngTarget Is Nothing Then Application.EnableEvents = False For Each rng In rngTarget If IsNumeric(rng.Value) Then rng.Value = -Abs(rng.Value) Next Application.EnableEvents = True End If End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "Kathy" wrote in message ... I need to know how to make a column so that when you type a number into it, it will become a negative number without you having to type the minus sign yourself. The regular negative number format does not work and I cannot come up with a custom one that works either. It must subtract when totaling the columns. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sum of all even and odd numbers between two columns | New Users to Excel | |||
How to sort random numbers in columns | Excel Discussion (Misc queries) | |||
Negative numbers turn positive automatically on data entry | Excel Discussion (Misc queries) | |||
How do you find duplicate values in excel- 2 columns of numbers | Excel Discussion (Misc queries) | |||
How do I take two columns of sequential numbers and insert spaces | Excel Discussion (Misc queries) |