+ Reply to Thread
Results 1 to 2 of 2

Can numbers be typed to automatically be negative in cells?

  1. #1
    finnplan
    Guest

    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. #2
    Gord Dibben
    Guest

    Re: 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 Special>Multiply>OK>Esc.

    Format to negative red using Format>Cells>Number>Number>Negative numbers.


    Gord Dibben Excel MVP


    Gord Dibben Excel MVP

    On Thu, 8 Dec 2005 13:21:02 -0800, "finnplan"
    <finnplan@discussions.microsoft.com> 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1