Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default How do I make a cell in Excel default to the negative value?

You cannot format a cell to be a negative number.

You could use event code to change the typed numbers to real negatives as you
enter them.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'change a number to negative
If Target.Column < 2 Then Exit Sub
If Not IsNumeric(Target.Value) Then Exit Sub
If Not Left(Target.Value, 1) = "-" Then
Application.EnableEvents = False
With Target
.Value = .Value * -1
End With
End If
Application.EnableEvents = True
End Sub

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

Copy/paste into that sheet module.

As written it operates on column 2(B) only. Adjust to suit column number or if
you have a non-contiguous range in mind post back.


Gord Dibben MS Excel MVP

On Thu, 6 Sep 2007 14:20:03 -0700, TVB Credit Manager <TVB Credit
wrote:

Hello, I'm creating a spreadsheet, and I'd like to have some of the cells
default to negative values no matter what value is input (positive or
negative).


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
SET DEFAULT VALUES IN CELL TO RECORD NEGATIVE Prasad Gopinath Excel Discussion (Misc queries) 3 November 24th 06 01:01 AM
how do you make negative numbers show up as 0 in Excel? djjny Excel Worksheet Functions 5 March 7th 06 05:42 PM
How to make the cell or font color red if the number is negative? Bob T Excel Worksheet Functions 6 August 18th 05 01:28 PM
How do I make all numbers in a column negative in excel 2000? jwoodruff77 Excel Discussion (Misc queries) 5 August 3rd 05 12:31 PM
make cell entries a negative number gls858 New Users to Excel 4 August 1st 05 11:00 PM


All times are GMT +1. The time now is 07:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"