PC Review


Reply
Thread Tools Rate Thread

Conditional Formatting / Positive vs. Negative

 
 
=?Utf-8?B?Sks=?=
Guest
Posts: n/a
 
      9th Aug 2007
Conditional Formatting

I want to change the font color of a number that is the negative value of
another number. I could conditionally format each cell individually, but that
would be too time-consuming (lots of numbers.)

For example; D5 = 22,443 & D12 = (22,443)

If one cell is the opposite of another cell, change the font color to hide
the negative value.

Any help would be appreciated…
Thx in advance.


 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      9th Aug 2007
Use a custom cell format of

##,##0;[Red](#,##0)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"JK" <(E-Mail Removed)> wrote in message
news:561EA09D-6EC4-4133-8FD0-(E-Mail Removed)...
> Conditional Formatting
>
> I want to change the font color of a number that is the negative value of
> another number. I could conditionally format each cell individually, but
> that
> would be too time-consuming (lots of numbers.)
>
> For example; D5 = 22,443 & D12 = (22,443)
>
> If one cell is the opposite of another cell, change the font color to hide
> the negative value.
>
> Any help would be appreciated.
> Thx in advance.
>
>



 
Reply With Quote
 
=?Utf-8?B?Sks=?=
Guest
Posts: n/a
 
      9th Aug 2007
That won't work...

Example:
The cell background is dark-grey. If the cell value (in that cell) is the
opposite value of another cell, then I want the font color to be dark-grey -
which would hide the numerical value.

It's not needed unless it's something other than the opposite value of the
other cell.

Thx tho.

"Bob Phillips" wrote:

> Use a custom cell format of
>
> ##,##0;[Red](#,##0)
>
> --
> HTH
>
> Bob
>
> (there's no email, no snail mail, but somewhere should be gmail in my addy)
>
> "JK" <(E-Mail Removed)> wrote in message
> news:561EA09D-6EC4-4133-8FD0-(E-Mail Removed)...
> > Conditional Formatting
> >
> > I want to change the font color of a number that is the negative value of
> > another number. I could conditionally format each cell individually, but
> > that
> > would be too time-consuming (lots of numbers.)
> >
> > For example; D5 = 22,443 & D12 = (22,443)
> >
> > If one cell is the opposite of another cell, change the font color to hide
> > the negative value.
> >
> > Any help would be appreciated.
> > Thx in advance.
> >
> >

>
>
>

 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      9th Aug 2007
Maybe something brute force like this:

Sub FormatCell()
Dim cell As Range, cell1 As Range
Selection.Font.ColorIndex = xlAutomatic
For Each cell In Selection
If IsNumeric(cell.Value) Then
If cell.Value < 0 Then
For Each cell1 In Selection
If IsNumeric(cell1) Then
If cell1 > 0 Then
If Abs(cell1 + cell) < 0.0000001 Then
cell.Font.ColorIndex = _
cell.Interior.ColorIndex
Exit For
End If
End If
End If
Next
End If
End If
Next
End Sub

--
Regards,
Tom Ogilvy

"JK" wrote:

> That won't work...
>
> Example:
> The cell background is dark-grey. If the cell value (in that cell) is the
> opposite value of another cell, then I want the font color to be dark-grey -
> which would hide the numerical value.
>
> It's not needed unless it's something other than the opposite value of the
> other cell.
>
> Thx tho.
>
> "Bob Phillips" wrote:
>
> > Use a custom cell format of
> >
> > ##,##0;[Red](#,##0)
> >
> > --
> > HTH
> >
> > Bob
> >
> > (there's no email, no snail mail, but somewhere should be gmail in my addy)
> >
> > "JK" <(E-Mail Removed)> wrote in message
> > news:561EA09D-6EC4-4133-8FD0-(E-Mail Removed)...
> > > Conditional Formatting
> > >
> > > I want to change the font color of a number that is the negative value of
> > > another number. I could conditionally format each cell individually, but
> > > that
> > > would be too time-consuming (lots of numbers.)
> > >
> > > For example; D5 = 22,443 & D12 = (22,443)
> > >
> > > If one cell is the opposite of another cell, change the font color to hide
> > > the negative value.
> > >
> > > Any help would be appreciated.
> > > Thx in advance.
> > >
> > >

> >
> >
> >

 
Reply With Quote
 
=?Utf-8?B?Sks=?=
Guest
Posts: n/a
 
      9th Aug 2007
I appreciate the effort; although, I'd have to apply this to many-many
different cells in my worksheet. I was hoping for a semi-simple solution
otherwise it's not really worth the effort.

But again, I do appreciate it.

"Tom Ogilvy" wrote:

> Maybe something brute force like this:
>
> Sub FormatCell()
> Dim cell As Range, cell1 As Range
> Selection.Font.ColorIndex = xlAutomatic
> For Each cell In Selection
> If IsNumeric(cell.Value) Then
> If cell.Value < 0 Then
> For Each cell1 In Selection
> If IsNumeric(cell1) Then
> If cell1 > 0 Then
> If Abs(cell1 + cell) < 0.0000001 Then
> cell.Font.ColorIndex = _
> cell.Interior.ColorIndex
> Exit For
> End If
> End If
> End If
> Next
> End If
> End If
> Next
> End Sub
>
> --
> Regards,
> Tom Ogilvy
>
> "JK" wrote:
>
> > That won't work...
> >
> > Example:
> > The cell background is dark-grey. If the cell value (in that cell) is the
> > opposite value of another cell, then I want the font color to be dark-grey -
> > which would hide the numerical value.
> >
> > It's not needed unless it's something other than the opposite value of the
> > other cell.
> >
> > Thx tho.
> >
> > "Bob Phillips" wrote:
> >
> > > Use a custom cell format of
> > >
> > > ##,##0;[Red](#,##0)
> > >
> > > --
> > > HTH
> > >
> > > Bob
> > >
> > > (there's no email, no snail mail, but somewhere should be gmail in my addy)
> > >
> > > "JK" <(E-Mail Removed)> wrote in message
> > > news:561EA09D-6EC4-4133-8FD0-(E-Mail Removed)...
> > > > Conditional Formatting
> > > >
> > > > I want to change the font color of a number that is the negative value of
> > > > another number. I could conditionally format each cell individually, but
> > > > that
> > > > would be too time-consuming (lots of numbers.)
> > > >
> > > > For example; D5 = 22,443 & D12 = (22,443)
> > > >
> > > > If one cell is the opposite of another cell, change the font color to hide
> > > > the negative value.
> > > >
> > > > Any help would be appreciated.
> > > > Thx in advance.
> > > >
> > > >
> > >
> > >
> > >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Formatting based on positive/negative numbers Nevyn Microsoft Excel Misc 2 7th Mar 2010 10:31 PM
Subtracting positive amts from negative and positive from positive bwbmom Microsoft Excel Worksheet Functions 3 12th Feb 2010 03:15 PM
RE: Conditional Formatting - colored arrow showing positive trend FSt1 Microsoft Excel Misc 0 24th Jun 2009 08:42 PM
Positive & negitive numbers in conditional formatting statement Frank Microsoft Access 2 6th Jan 2008 08:17 PM
Formula to make Negative Values Positive & Positive Values Negative? mustard Microsoft Excel Misc 4 26th Sep 2005 10:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:52 PM.