Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Conditional Formatting - Losing Values | Excel Discussion (Misc queries) | |||
Negative Conditional Formatting Excel 2003 | Excel Discussion (Misc queries) | |||
apply conditional formatting to negative cell values | Excel Discussion (Misc queries) | |||
conditional formatting with time values | Excel Discussion (Misc queries) | |||
Values w/conditional formatting | Excel Worksheet Functions |