LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default 6 conditional formats in Excel 2002


Try placing this in the sheet code module
Untested, but should work...

Tim


Private Sub Worksheet_Activate()
UpdateFormats
End Sub

Sub UpdateFormats()
Dim c As Range, rng As Range
Dim Store, Pos, EmpName, Rating
Dim cIndex As Integer

'loop through each cell which needs formatting
For Each c In Me.Range("B2:E4").Cells

Store = c.EntireColumn.Cells(1).Value
Pos = c.EntireRow.Cells(1).Value
EmpName = c.Value
Rating = ""
cIndex = xlNone
'look for the employee in the relevant sheet
'(assumed sheets named "Store 1","Store 2" etc)
Set rng = ThisWorkbook.Sheets(Store).Cells(1)
Do While Len(rng.Value) 0
If rng.Value = Pos And rng.Offset(0, 1).Value = EmpName
Then
Rating = rng.Offset(0, 2).Value
Exit Do
End If
Set rng = rng.Offset(1, 0)
Loop

If Rating < "" Then
Select Case Rating
Case "High Potential": cIndex = 1
Case "High Value": cIndex = 2
'etc etc
End Select

End If

c.Interior.ColorIndex = cIndex

Next c
End Sub




On Jan 13, 5:53*pm, Tracey wrote:
I have 4 sheets that detail a group of Stores and their Personnel by their
Jobs and the Performance rating for last year and a fifth sheet that
summaries all of this data

e.g.
Sheet 1 = Store 1

Col A * * * * *Col B * * * * *Col C * * * * * * * * * * * * *
Manager * * Bob * * * * * *High Potential
Meat Mgr * *Carol * * * * *High Value
Bake Mgr * *Ted * * * * * *Performance Manage

Sheet 2 = Store 2 etc

Sheet 5 summarises all of the other 4 to give a complete list for the region
via a link to each individual store sheet
e.g.

Row * *Col A * * * * Col B * * * * *Col C * * * * Col D * * * * * Col E
* * * * * * * * * * * * * *Store 1 * * * Store 2 * * *Store 3 * * * *Store 4
Row 2 Manager * *Bob * * * * * * Alice * * * * Goofy * * * * * Daisy
Row 3 Meat Mgr * Carol * * * * * Mickey * * *Clarabelle * * Tracey
Row 4 Bake Mgr * Ted * * * * * * Minnie * * * Donald * * * * etc

I need to format cells B2 through E4 based on their Performance rating in
Col C from their Store sheet.

High Potential * * * * * *= Blue
High Value * * * * * * * *= Yellow
Performance Manage = Red
Promotable Next Lvl * = Green
Promotable Current * *= Light Green
Too Soon to call * * * * = Blank

I hope this makes sense... thanks for your time Gord.

--
Tracey @ BrisVegas


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Formats, how to scroll and view all formats? Bill E Excel Worksheet Functions 0 May 12th 10 07:58 PM
Conditional formats- paste special formats? jcarney Excel Discussion (Misc queries) 1 November 1st 07 06:37 PM
Excel 2002: Can I attach different file formats to excel files ? Mr. Low Excel Discussion (Misc queries) 2 July 2nd 07 06:14 PM
error message in excel 2002 too many cell formats Edgar Grumps Danard Excel Discussion (Misc queries) 1 May 9th 06 12:43 AM
Excel 2003 formats different that excel 2002 Rich Excel Discussion (Misc queries) 0 April 22nd 05 05:43 PM


All times are GMT +1. The time now is 07:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"