Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

access conditional formatting

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Access - Conditional Formatting

Access - Conditional Formatting

ResolvedVersion 2003

Lisa has attended:
Excel VBA Intro Intermediate course

Access - Conditional Formatting

How do you get 5 conditions? - The following colours:-
Red
Orange
Yellow
Light Green
Dark Green

RE: Access - Conditional Formatting

Hi Lisa,

I hope you found the training useful. Regarding to your question, there is a way to trigger the multiple conditional formats upon every change of colour entry.

1. Make the colour list on a chosen cell, DATA menu > Validation > choose List as your criteria
2. In the Source box, type in your colour list Red, Orange, Yellow, Light Green, Dark Green > press OK
3. Right click the Sheet tab and select View Code
4. Paste the following code under Option Explicit

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Compare Text
Private Sub Worksheet_Change(ByVal Target As Range)
If ActiveCell.Value = "Red" Then
With ActiveCell
.Interior.ColorIndex = 3
.Font.Bold = True
.Font.ColorIndex = 3
End With

ElseIf ActiveCell.Value = "Orange" Then
With ActiveCell
.Interior.ColorIndex = 46
.Font.Bold = True
.Font.ColorIndex = 46
End With

ElseIf ActiveCell.Value = "Yellow" Then
With ActiveCell
.Interior.ColorIndex = 6
.Font.Bold = True
.Font.ColorIndex = 6
End With

ElseIf ActiveCell.Value = "Light Green" Then
With ActiveCell
.Interior.ColorIndex = 35
.Font.Bold = True
.Font.ColorIndex = 35
End With

ElseIf ActiveCell.Value = "Dark Green" Then
With ActiveCell
.Interior.ColorIndex = 10
.Font.Bold = True
.Font.ColorIndex = 10
End With

End If
End Sub

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
N.B. Worksheet_Change is part of the event procedure choices on each worksheet. See p.20 in the book.

Hope this helps

Regards,

Katie
Microsoft Certified Tainer

Excel tip:

Shortcut fill a cell with contents from adjacent cells

Use Control + D to fill a cell with the data from an adjacent cell. This speeds up data entry and is a cool tip to share!


View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.11 secs.