Condional formatting multiple entries

QuizToon

New Member
Joined
Jan 31, 2009
Messages
28
Hi All,

I am sure this is a simple answer to those in the now, unfortunately I am not one of them.

I have a spreadsheet that works as a kind of rota. There are 12 venues in a column . I have 19 staff members. 1 staff member cold be in any of the venues on any given day for the week.

All I wan to do is have the cell change colour depending on who's name appears in it. Different colour for each staff member.

So basically a cell colour for each staff member for whenever the appear in the rota.

The rotas are done months in advance so it becomes quite an issue for a large spreadsheet, I thought it might be better suited to VBA.

The range is from I11 to NO26 (there are some blank rows which need to stay in the sheet

Hope this makes sense.

Thanks in advance
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
You can setup a rule for each person & just use a formula in conditional formatting like
=I11="QuizToon"
 
Upvote 0
You can, but how would you want the code run?
 
Upvote 0
HI Fluff,

I was hoping that it would just run automatically after I had inserted the text in the cell. Is this not possible?
 
Upvote 0
You can put this in the sheet module for that sheet
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
   If Target.CountLarge > 1 Then Exit Sub
   If Not Intersect(Target, Range("I11:NO26")) Is Nothing Then
      Select Case LCase(Target.Value)
         Case "bob"
            Target.Interior.ColorIndex = 35
         Case "mary"
            Target.Interior.ColorIndex = 14
      End Select
   End If
End Sub
All the names need to be in lower case, but will not matter how they're entered on the actual sheet.
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,385
Members
448,956
Latest member
JPav

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