More conditional formats needed!

postmatt

New Member
Joined
Nov 3, 2008
Messages
4
Hi, I have a spreadsheet with multiple sheets set up. Information that is entered on one overview sheet is then automatically pulled through onto multiple other sheets displaying different parts of the data.

I either need to find a way for the even the colour of a cell to be pulled through onto the other sheets as well as the data in the cell.....or alternatively I need to set up the cells on the other sheets with conditional formatting so they recognise the data being pulled through and the cell colour is formatted accordingly. However if I use this method I need to find a way to have more than 3 coditions on the conditional formatting of the cell.

Is there some way to do this using IF statements and a separate formula set up?

Any help would be appreciated....
Thanks
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Hi Matt and welcome to the board,

Quoting Jon von der Heyden, try to adapt this.

Here's a quick example of how this could be done:

I have assumed that you want to apply the conditions only between A1:B6. I have stipulated as follows:

If the cell equals "a" then make red
if "b" then make green
if "c" make grey
if "d" make pink
if "e" make blue

To test this open a new workbook. Go to the VBE (Alt+F11).
Project - VBAProject double click the desired sheet and paste this code into the page area (big white pane on the right)

Code:
Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo Finish

With Target
    If .Row < 7 And .Column < 3 Then
        Select Case .Value
            Case "a"
                .Font.ColorIndex = 3
            Case "b"
                .Font.ColorIndex = 10
            Case "c"
                .Font.ColorIndex = 16
            Case "d"
                .Font.ColorIndex = 22
            Case "e"
                .Font.ColorIndex = 28
        End Select
    End If
End With

Finish: Exit Sub

End Sub

Note, the example attached changes only font color, but we can actually change other format properties instead if desired.
 
Upvote 0
Many thanks,

This looks like it could be very useful for what I need.

However, I have to confess I am not particularly up to scratch on my VB code and whether you could assist with a couple of amendments I would require....

How would the IF statement need to be written if the cells in question were A29:J29 for example?

Also, what would the correct code be to change the Fill volour of the cell as opposed to the .Font.ColorIndex part of the code?


If anyone could assist with this part I would be very grateful as the rest I can handle myself.


Many thanks again,

Matt
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top