#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Negative entry

Can I format cells so that any number entered into it is shown as negative
automatically ie not having to make the entry with a minus sign


Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Negative entry

The simplest way is to use two cells:

Enter your data in A1 and in B1:

=-A1

Thus saving a keystroke.

Another way involves event macros.
--
Gary''s Student - gsnu200755


"GeeTee" wrote:

Can I format cells so that any number entered into it is shown as negative
automatically ie not having to make the entry with a minus sign


Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Negative entry

(General);(General)

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"GeeTee" wrote in message
...
Can I format cells so that any number entered into it is shown as negative
automatically ie not having to make the entry with a minus sign


Thanks



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Negative entry

Hi,

Not with a format because that will make the number look negative when in
fact it would not change the underlying value. This may help. Right click the
sheet tab, view code and paste this in:-

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A1:B10")) Is Nothing Then ' Change to suit
If IsNumeric(Target) Then
Application.EnableEvents = False
Target.Value = Target.Value * -1
Application.EnableEvents = True
End If
End If
End Sub

Mike

"GeeTee" wrote:

Can I format cells so that any number entered into it is shown as negative
automatically ie not having to make the entry with a minus sign


Thanks

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 364
Default Negative entry

But be aware that this changes only the way the number is shown, not the
underlying value. So if the value is then used elsewhere in a formula, the
positive value will be used, which I would find very confusing. Whilst this
is exactly what the OP asked, it may well not be what was wanted! Certainly
the OP should be made aware of this.

"Bob Phillips" wrote in message
...
(General);(General)

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"GeeTee" wrote in message
...
Can I format cells so that any number entered into it is shown as
negative
automatically ie not having to make the entry with a minus sign


Thanks







  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Negative entry

To you point:

Format Cells... Number Custom
"-"General" (only joking)"

--
Gary''s Student - gsnu200755


"Stephen" wrote:

But be aware that this changes only the way the number is shown, not the
underlying value. So if the value is then used elsewhere in a formula, the
positive value will be used, which I would find very confusing. Whilst this
is exactly what the OP asked, it may well not be what was wanted! Certainly
the OP should be made aware of this.

"Bob Phillips" wrote in message
...
(General);(General)

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"GeeTee" wrote in message
...
Can I format cells so that any number entered into it is shown as
negative
automatically ie not having to make the entry with a minus sign


Thanks






  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Negative entry

Thank guys for the prompt responses, and yes I did want to change the value
to negatve, I had tried custom format. I continually enter amounts into a
column that are neg and wanted to save a keystroke

"GeeTee" wrote:

Can I format cells so that any number entered into it is shown as negative
automatically ie not having to make the entry with a minus sign


Thanks

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Negative entry

I tend to respond to the question asked unless it is ambiguous or clearly
mis-stated.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Stephen" <none wrote in message
...
But be aware that this changes only the way the number is shown, not the
underlying value. So if the value is then used elsewhere in a formula, the
positive value will be used, which I would find very confusing. Whilst
this is exactly what the OP asked, it may well not be what was wanted!
Certainly the OP should be made aware of this.

"Bob Phillips" wrote in message
...
(General);(General)

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"GeeTee" wrote in message
...
Can I format cells so that any number entered into it is shown as
negative
automatically ie not having to make the entry with a minus sign


Thanks







  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Negative entry

You can use event code behind the sheet.

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1:A100"
Dim cell As Range

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
For Each cell In Target
If Left(cell.Value, 1) < "-" Then
cell.Value = cell.Value * -1
End If
Next cell
End If

ws_exit:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-click the sheet tab and "View Code".

Copy/paste into that sheet module. Adjust range to suit.


Gord Dibben MS Excel MVP

On Mon, 12 Nov 2007 04:51:01 -0800, GeeTee
wrote:

Thank guys for the prompt responses, and yes I did want to change the value
to negatve, I had tried custom format. I continually enter amounts into a
column that are neg and wanted to save a keystroke

"GeeTee" wrote:

Can I format cells so that any number entered into it is shown as negative
automatically ie not having to make the entry with a minus sign


Thanks


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
stop entry of data that causes a negative value from a formula pmms Excel Discussion (Misc queries) 3 November 23rd 07 05:30 PM
Auto negative entry Darrell Shuman Excel Worksheet Functions 1 March 9th 07 06:31 PM
Negative Entry to calculate remaining inventory Ian Excel Discussion (Misc queries) 2 February 20th 07 05:40 PM
Cell Entry That Locks Selected Cells From Any Data Entry. ron Excel Worksheet Functions 5 February 16th 07 09:52 PM
Negative numbers turn positive automatically on data entry Jerri Excel Discussion (Misc queries) 4 January 8th 05 05:05 PM


All times are GMT +1. The time now is 04:36 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"