Not enough conditional formats

xyzabc198

Board Regular
Joined
Jul 30, 2008
Messages
126
I recently tried to create conditional formatting for the following

If cell = CB turn Yellow Black text bold and itallic
If cell = S/Lit turn Bright Green Black text bold and itallic
If cell = NI turn Gray 40% Black text bold and itallic
If cell = email turn Aqua Black text bold and itallic
If cell = MR turn Lime Black text bold and itallic
If cell = Cleansed turn Rose Black text bold and itallic
If cell = Dup turn Tan Black text bold and itallic
If cell = DNC turn Red Black text bold and itallic
If cell = KW turn Light Orange Black text bold and itallic
If cell = Lead turn Lavander Black text bold and itallic
If cell = LTC turn Plum with white text Bold & Itallic
If cell = Appt turn Pink Black text bold and itallic
If cell = Quote turn Light Blue white text Bold & Itallic
If cell = XAPPT turn Sea Green Black text bold and itallic
If cell = XC turn Dark Yellow Black text bold and itallic

Obviously there is only 3 conditionals available, not 15...
Any other way to do this? maybe a macro? thanks!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Probably a vba code on Worksheet.Change event ..... something like

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Select Case Target.Value
    Case "CB"
        With Target
        .Font.Bold = True
        .Font.Italic = True
        .Font.ColorIndex = 1
        .Interior.Color = vbYellow
        End With
    Case "S/Lit"
        With Target
        .Font.Bold = True
        .Font.Italic = True
        .Font.ColorIndex = 1
        .Interior.Color = vbGreen
        End With
End Select
End Sub

[\Code]
 
Upvote 0
Probably a vba code on Worksheet.Change event ..... something like

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Select Case Target.Value
Case "CB"
With Target
.Font.Bold = True
.Font.Italic = True
.Font.ColorIndex = 1
.Interior.Color = vbYellow
End With
Case "S/Lit"
With Target
.Font.Bold = True
.Font.Italic = True
.Font.ColorIndex = 1
.Interior.Color = vbGreen
End With
End Select
End Sub
 
[\Code][/quote]
 
And where would I enter this?
 
Upvote 0
Probably a vba code on Worksheet.Change event ..... something like

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Select Case Target.Value
Case "CB"
With Target
.Font.Bold = True
.Font.Italic = True
.Font.ColorIndex = 1
.Interior.Color = vbYellow
End With
Case "S/Lit"
With Target
.Font.Bold = True
.Font.Italic = True
.Font.ColorIndex = 1
.Interior.Color = vbGreen
End With
End Select
End Sub
 
[\Code][/quote]
 
OK I worked out where to enter it but it keep coming up with 
Compile Error:
Invalid outside procedure???
 
Upvote 0
That's probably a problem with how you pasted it.

Can you post ALL the code that is in that module ?
 
Upvote 0
That's probably a problem with how you pasted it.

Can you post ALL the code that is in that module ?

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Select Case Target.Value
Case "CB"
With Target
.Font.Bold = True
.Font.Italic = True
.Font.ColorIndex = 1
.Interior.Color = vbYellow
End With
Case "S/Lit"
With Target
.Font.Bold = True
.Font.Italic = True
.Font.ColorIndex = 1
.Interior.Color = vbGreen
End With
End Select
End Sub
[\Code]
 
Upvote 0
That code as you posted it works fine for me.

Are you sure that is ALL the code in the Sheet's Module (not just the code you think is relevant, but EVERYTHING in that module) ?

Also, are you putting it in the Sheet Module (right click the sheet's tab, view code)?
 
Upvote 0

Forum statistics

Threads
1,215,178
Messages
6,123,484
Members
449,100
Latest member
sktz

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