PC Review


Reply
Thread Tools Rate Thread

Conditional formatting based on formatting

 
 
=?Utf-8?B?VGhlUm9vaw==?=
Guest
Posts: n/a
 
      1st Nov 2006
I am wanting to conditionally format a cell so that it fills the cell in
bright green if a specific cell is formatted bright green. Example

If A1 is filled bright green, B1 would automatically fill in bright green.

Is this possible
 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      1st Nov 2006
If B1 is filled with bright green by conditional formatting, then you would
use similar logic for the other cell. Instead of Cell Value is, you might
need to change the dropdown to formula is in the Conditional formatting menu.


If the cell is colored by the user, then there would be no easy way to
detect that since coloring a cell does not trigger an event or a recalculate
and there are no built in functions that will detect the coloring of a cell.
You could write a user defined function in VBA possibly, is that what you
want?

--
Regards,
Tom Ogilvy


"TheRook" wrote:

> I am wanting to conditionally format a cell so that it fills the cell in
> bright green if a specific cell is formatted bright green. Example
>
> If A1 is filled bright green, B1 would automatically fill in bright green.
>
> Is this possible

 
Reply With Quote
 
=?Utf-8?B?VGhlUm9vaw==?=
Guest
Posts: n/a
 
      1st Nov 2006
Yes, I think so. The cell will be filled in by someone so the same logic can
not be adapted.

I am not experienced in VBA but have previously posted regarding counting
coloured cell and thought there maybe a simular way to do this.

Cheers

"Tom Ogilvy" wrote:

> If B1 is filled with bright green by conditional formatting, then you would
> use similar logic for the other cell. Instead of Cell Value is, you might
> need to change the dropdown to formula is in the Conditional formatting menu.
>
>
> If the cell is colored by the user, then there would be no easy way to
> detect that since coloring a cell does not trigger an event or a recalculate
> and there are no built in functions that will detect the coloring of a cell.
> You could write a user defined function in VBA possibly, is that what you
> want?
>
> --
> Regards,
> Tom Ogilvy
>
>
> "TheRook" wrote:
>
> > I am wanting to conditionally format a cell so that it fills the cell in
> > bright green if a specific cell is formatted bright green. Example
> >
> > If A1 is filled bright green, B1 would automatically fill in bright green.
> >
> > Is this possible

 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      1st Nov 2006
Think you will have to use the calculate event. I tried a UDF in conditional
formatting, and it caused excel to crash. Even if used through a defined
name.

Maybe someone else knows a better trick.


--
Regards,
Tom Ogilvy


"TheRook" wrote:

> Yes, I think so. The cell will be filled in by someone so the same logic can
> not be adapted.
>
> I am not experienced in VBA but have previously posted regarding counting
> coloured cell and thought there maybe a simular way to do this.
>
> Cheers
>
> "Tom Ogilvy" wrote:
>
> > If B1 is filled with bright green by conditional formatting, then you would
> > use similar logic for the other cell. Instead of Cell Value is, you might
> > need to change the dropdown to formula is in the Conditional formatting menu.
> >
> >
> > If the cell is colored by the user, then there would be no easy way to
> > detect that since coloring a cell does not trigger an event or a recalculate
> > and there are no built in functions that will detect the coloring of a cell.
> > You could write a user defined function in VBA possibly, is that what you
> > want?
> >
> > --
> > Regards,
> > Tom Ogilvy
> >
> >
> > "TheRook" wrote:
> >
> > > I am wanting to conditionally format a cell so that it fills the cell in
> > > bright green if a specific cell is formatted bright green. Example
> > >
> > > If A1 is filled bright green, B1 would automatically fill in bright green.
> > >
> > > Is this possible

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      1st Nov 2006
Typically user selects cell(s) before formatting. You could try the
following which should format cell to right of any in "myRange" that's
bright green after user makes a new selection.

Dim muffling As Boolean
Dim miring As Range

Private Sub Worksheet_Deactivate()
If muffling Then
Colour
End If
End Sub

Private Sub Worksheet_Selection(By Target As Range)
If muffling Then
Colour
End If

If Not Intersect(Range("myRange"), Target) Is Nothing Then
muffling = True
Set miring = Intersect(Range("myRange"), Target)
End If

End Sub

Private Sub Colour()
Dim cel As Range
On Error GoTo errH
' #4 is the colorindex for Bright Green in a default palette
For Each cel In miring
If cel.Interior.ColorIndex = 4 Then
If cel.Column < Me.Columns.Count Then
cel.Offset(0, 1).Interior.ColorIndex = 4
End If
End If
Next
errH:
muffling = False
Set miring = Nothing

End Sub

Code belongs in the relevant sheet module. Right-click sheet tab > View Code

In this example "myRange" is a named range, only refer to this name as above
in a sheet module containing the name. Note named ranges can be moved, eg
drag cells, insert columns etc or removed. Alternatively hard code the
address of cell(s) to check.

As written the code does not clear the 'right' cell colour if left cell's
green is changed, easily adapted.

Regards,
Peter T




You could try the following and see if
"TheRook" <(E-Mail Removed)> wrote in message
news:F2679BC9-6D89-48DA-A43B-(E-Mail Removed)...
> Yes, I think so. The cell will be filled in by someone so the same logic

can
> not be adapted.
>
> I am not experienced in VBA but have previously posted regarding counting
> coloured cell and thought there maybe a simular way to do this.
>
> Cheers
>
> "Tom Ogilvy" wrote:
>
> > If B1 is filled with bright green by conditional formatting, then you

would
> > use similar logic for the other cell. Instead of Cell Value is, you

might
> > need to change the dropdown to formula is in the Conditional formatting

menu.
> >
> >
> > If the cell is colored by the user, then there would be no easy way to
> > detect that since coloring a cell does not trigger an event or a

recalculate
> > and there are no built in functions that will detect the coloring of a

cell.
> > You could write a user defined function in VBA possibly, is that what

you
> > want?
> >
> > --
> > Regards,
> > Tom Ogilvy
> >
> >
> > "TheRook" wrote:
> >
> > > I am wanting to conditionally format a cell so that it fills the cell

in
> > > bright green if a specific cell is formatted bright green. Example
> > >
> > > If A1 is filled bright green, B1 would automatically fill in bright

green.
> > >
> > > Is this possible



 
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 2 conditions Still learning@work Microsoft Excel Misc 3 7th Apr 2009 11:11 PM
Conditional Formatting Based of Cells Based on Data Entry in anoth Jim Microsoft Excel Misc 3 11th Nov 2008 11:52 PM
conditional Formatting based on cell formatting Totom Microsoft Excel Worksheet Functions 1 20th Jan 2007 02:02 PM
conditional Formatting based on cell formatting Totom Microsoft Excel Worksheet Functions 0 15th Jan 2007 04:35 PM
Conditional Formatting Based on If and Or =?Utf-8?B?bHV2dGhhdm9ka2E=?= Microsoft Excel Misc 5 10th Aug 2006 10:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:34 AM.