Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default CONDITIONAL FORMATTING & NEGATIVE VALUES

I have a column D containing the names of some expenses and Income categories
and I want in column F to manually enter numbers which they will become
negative if the value in column D is an expense category or positive if the
value in column D is an Income Category
--
sato panago
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default CONDITIONAL FORMATTING & NEGATIVE VALUES

If you are manually entering numbers in a cell they cannot be formatted or
manipulated to be negative based upon a value in another cell.

You would need VBA for this.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Cells.Column = 6 Then
On Error GoTo enditall
Application.EnableEvents = False
n = Target.Row
With Me.Range("D" & n)
If .Value < "" _
And .Value = "expense" Then
With Me.Range("F" & n)
.Value = .Value * -1
End With
End If
End With
End If
enditall:
Application.EnableEvents = True
End Sub

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

Copy/paste to that module.


Gord Dibben MS Excel MVP

On Sun, 28 Feb 2010 11:18:01 -0800, sato wrote:

I have a column D containing the names of some expenses and Income categories
and I want in column F to manually enter numbers which they will become
negative if the value in column D is an expense category or positive if the
value in column D is an Income Category


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
Conditional Formatting - Losing Values Dana Excel Discussion (Misc queries) 7 November 26th 09 04:34 PM
Negative Conditional Formatting Excel 2003 Quandary Excel Discussion (Misc queries) 2 July 16th 09 03:21 AM
apply conditional formatting to negative cell values dona Excel Discussion (Misc queries) 2 March 10th 06 12:04 PM
conditional formatting with time values Access Idiot Excel Discussion (Misc queries) 2 September 13th 05 03:29 PM
Values w/conditional formatting Fred Timmons Excel Worksheet Functions 7 January 4th 05 03:31 AM


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