Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
finnplan
 
Posts: n/a
Default Can numbers be typed to automatically be negative in cells?

I am a new excel user.

I am doing a basic spread sheet. I would like to have cells formated so
that when I type in a number it automatically is negative and appears red.
Is this possible. I have not been able to ask "help" correctly to find it.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Gord Dibben
 
Posts: n/a
Default Can numbers be typed to automatically be negative in cells?

finn

Not without resorting to some event code to turn the numbers negative.

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:D100")) Is Nothing Then
With Target
If .Value < "" Then
.Value = .Value * -1
.NumberFormat = "0.00_);[Red](0.00)"
End If
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub


This is worksheet event code.

Right-click on the sheet tab and "View Code". Copy/paste into that module.

NOTE: the Me.Range can be altered to what you wish.

Maybe a simpler way would be to not use the event code and just enter the
numbers as positive then put -1 in an empty cell. Copy that cell, select your
range of numbers and Paste SpecialMultiplyOKEsc.

Format to negative red using FormatCellsNumberNumberNegative numbers.


Gord Dibben Excel MVP


Gord Dibben Excel MVP

On Thu, 8 Dec 2005 13:21:02 -0800, "finnplan"
wrote:

I am a new excel user.

I am doing a basic spread sheet. I would like to have cells formated so
that when I type in a number it automatically is negative and appears red.
Is this possible. I have not been able to ask "help" correctly to find it.

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
Adjust the size of cells automatically Dajana Excel Discussion (Misc queries) 1 September 6th 05 02:56 PM
Automatically filling in cells based on another cell's content Ginger Excel Worksheet Functions 5 September 2nd 05 09:17 AM
How do I apply a formula to #s already typed in a series of cells redinBR Excel Worksheet Functions 1 May 18th 05 11:09 PM
Negative numbers turn positive automatically on data entry Jerri Excel Discussion (Misc queries) 4 January 8th 05 05:05 PM
Protected cells -automatically format to a different color Fred Evans Excel Discussion (Misc queries) 9 December 3rd 04 12:59 PM


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