conditional formatting
Microsoft Office Training McAfee Secure sites help keep you safe from identity theft, credit card fraud, spyware, spam, viruses and online scams add this page to your favourites/bookmarksAdd to favourites
view a printable version of this pagePrintable version
email this page to somebodyEmail this page
Customer: Sign in
Delegate: Sign in
Trainer: Log in

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

Conditional Formatting

The UK's most regular instructor-led training courses.
Training information: excel+course · Advanced.excel · Microsoft Excel Training London
See also · excel-courses-london · excel courses in london · excel microsoft training

resolvedResolved · Urgent Priority · Version 2003

Conditional Formatting

Lisa has attended:
Excel VBA course

by - delegate Lisa [22 posts] (2008 Jun 8 Sun, 17:20) replyReply

With Conditional Formatting you can only get 3 conditions.

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

This would be starting in coloum E6 to E63?

Excel Advanced 1 day course
Version Date Location Places
available
Book Next place rate:
Card Invoice
2007 2009 Jan 14 Wed Bloomsbury 5 book now £235 £245
2002/XP 2009 Jan 14 Wed Tooting 0 FULL    
2003 2009 Jan 16 Fri Southwark 0 FULL    
2007 2009 Jan 21 Wed Bloomsbury 3 book now £240 £245
2003 2009 Jan 21 Wed Southwark 2 book now £235 £240
2003 2009 Jan 23 Fri Bayswater 4 book now £195 £205
Full Schedule: See all 113 Excel Advanced course dates.
Bookings currently available until 31st March 2010.

RE: Conditional Formatting

by - trainer Katie gold contributer[214 posts] (2008 Jun 8 Sun, 23:42) replyReply

Hi Lisa,

This scenario is slightly diffrent becuase of the fixed cell range (a fixed target), which means you can use the FOR structure. The previous scenario will wait for a new data entry to trigger the colour change.

Here is the sample codes:
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub ConditionalFormat()
Dim Counter As Integer
Dim Row As Integer 'The row being copied
Dim TotalRows As Integer 'Number of Colour Entries

Row = 2

Sheets("Sheet1").Select
Range("E6").Select

TotalRows = Range("E6").CurrentRegion.Rows.count
Debug.Print TotalRows

'Red
For Counter = 1 To TotalRows
If Cells(Row, 5).Value = "Red" Then
With Cells(Row, 5)
.Interior.ColorIndex = 3
.Font.Bold = True
.Font.ColorIndex = 3
End With

'Orange
ElseIf Cells(Row, 5).Value = "Orange" Then
With Cells(Row, 5)
.Interior.ColorIndex = 46
.Font.Bold = True
.Font.ColorIndex = 46
End With

'Yellow
ElseIf Cells(Row, 5).Value = "Yellow" Then
With Cells(Row, 5)
.Interior.ColorIndex = 6
.Font.Bold = True
.Font.ColorIndex = 6
End With

'Light Green
ElseIf Cells(Row, 5).Value = "Light Green" Then
With Cells(Row, 5)
.Interior.ColorIndex = 35
.Font.Bold = True
.Font.ColorIndex = 35
End With

'Dark Green
ElseIf Cells(Row, 5).Value = "Dark Green" Then
With Cells(Row, 5)
.Interior.ColorIndex = 10
.Font.Bold = True
.Font.ColorIndex = 10
End With
End If

Row = Row + 1 'Moves to next row after formatting
Next Counter


End Sub

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

See if this helps.

Katie
Microsoft Certified Trainer


Related articles

· How Small Businesses Profit from Outside Excel Training
· Advanced Excel and PivotTable Reports
· Reasons Why VBA for Excel Training Fails
· Take the Anxiety out of Domestic Finances with Microsoft Excel
· Microsoft Excel Courses Teach Advanced Macro Techniques

Please browse our web site to find out more about
excel+course and other Microsoft training courses.

Excel tip:

Conditional formatting for cells that return text , not picked up by Go to command

If you have tried to format all cells containing text even those that display text as a result of a formula you may have had difficulty. As Go to command with constant selected does not pick up formulas that result in text.

Then try this. Select the range the formula cells appear in on your sheet. Format, select Conditional Formatting menu. In the dialog box under Condition 1, select "Formula Is" from drop down. Next to it in the Formula Box, enter the formula =Istext(A1. Click Format button , choose desired formatting settings and click OK. To go ahead and apply the conditional formatting click OK to accept

View all Excel hints and tips

Rate this page:
3.0/5 (5 votes cast)
Institute of IT Training - Accredited Training Provider Microsoft Certified Partner
microsoft office
Microsoft Office Specialist Authorised Testing Centre (MOS and MCAS)

Prodigy Platinum Learning Partner

Institute of IT Training - Accredited Training Provider Association of Computer Trainers Valid HTML 4.01 Transitional
Valid CSS Markup

secure online payments - visa - mastercard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Training by application Main information pages See also

Access courses
DreamWeaver courses
Excel courses
MS Project courses
Outlook courses
PowerPoint courses
VBA courses
Word courses
(more...)

Public scheduled courses
On-site training
Closed company courses

Training venues
Client list
FAQ
Pricing and availability
Course details / Syllabus

Access training
Dreamweaver training
Excel training
MS Project training
PowerPoint training

London Computer Training
Computer Training London
Microsoft Office training

Microsoft Access training
Microsoft Excel training
Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training

Time Management Course London

Interested in Access training? Please see the following pages:
Microsoft access courses · Microsoft training access course
Microsoft+access+training · Access courses in london

Training Information
Training Articles

AddThis Social Bookmark Button What's this?
Add to: Add to Del.icio.us Add to Facebook Add to Digg Add to Reddit Add to Google Add to Yahoo