access conditional formatting

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

Access - Conditional Formatting

resolvedResolved · Low Priority · Version 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:

Enter formulae into multiple cells

If a formula is to be used in a series of cells, select the cells first. Now type in your formula and hold the Ctrl key while you press Enter. This enters the formula in each selected cell.

Just be careful with your absolute and relative cell references.

View all Excel hints and tips


Server loaded in 0.05 secs.