#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Conditional format

i have a list
a b
5000 c
5000 d
and i want to make the value of colum a to be negative if the value of colum
b is equal to c, i just can't figure it out. please help
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,047
Default Conditional format

if you have a number on the column a I will sugest you to create a new column
between A and B (new column B) and you will have

A1 = 5000
B1 = =if(c1=d1,-a1,a1)
C1 = a
D1 = a

hth

--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"motel113" escreveu:

i have a list
a b
5000 c
5000 d
and i want to make the value of colum a to be negative if the value of colum
b is equal to c, i just can't figure it out. please help

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Conditional format

You cannot do that with Conditional Format.

Changing a format does not change the underlying value of the cell.

You could use a helper column and enter a formula.........

=IF(B1="c",A1*-1,"not equal c") copy down column C

This won't change the values in column A to negative but will give you a
negative in column C

OR you could use event code to do it in place assuming you have the letters in
column B and are entering numbers in Column A

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
n = Target.Row
If Target.Offset(0, 1).Value = "c" Then
With Target
.Value = .Value * -1
End With
End If
End If
enditall:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Tue, 10 Jun 2008 11:17:00 -0700, motel113
wrote:

i have a list
a b
5000 c
5000 d
and i want to make the value of colum a to be negative if the value of colum
b is equal to c, i just can't figure it out. please help


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Conditional format

thank you for your help that worked perfectly

"Gord Dibben" wrote:

You cannot do that with Conditional Format.

Changing a format does not change the underlying value of the cell.

You could use a helper column and enter a formula.........

=IF(B1="c",A1*-1,"not equal c") copy down column C

This won't change the values in column A to negative but will give you a
negative in column C

OR you could use event code to do it in place assuming you have the letters in
column B and are entering numbers in Column A

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
n = Target.Row
If Target.Offset(0, 1).Value = "c" Then
With Target
.Value = .Value * -1
End With
End If
End If
enditall:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Tue, 10 Jun 2008 11:17:00 -0700, motel113
wrote:

i have a list
a b
5000 c
5000 d
and i want to make the value of colum a to be negative if the value of colum
b is equal to c, i just can't figure it out. please help



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
New Conditional Format Overriding Previous Conditional Format Rene Excel Discussion (Misc queries) 3 February 27th 08 06:08 PM
How to create a conditional format that changes the number format tmbo Excel Discussion (Misc queries) 1 August 23rd 06 06:20 AM
Conditional Format - Format Transfer To Chart ju1eshart Excel Discussion (Misc queries) 0 June 1st 06 02:46 PM
copy conditional format to regular format GDC Setting up and Configuration of Excel 3 May 4th 05 09:35 PM
copy conditional format as ACTUAL format Dana Zulager Excel Discussion (Misc queries) 7 December 7th 04 11:02 PM


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

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"