Thread: How Do I...
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Michael Koerner Michael Koerner is offline
external usenet poster
 
Posts: 164
Default How Do I...

Thanks Nigel. I think I need a little more than Luck <g My knowledge of VBA, is
less than my knowledge of Excel. I would also like the change to be
instantaneous. when I change/enter a condition in column D on sheet one I would
like the background colour to change according to the corresponding number in
sheet 2.

--

Regards
Michael Koerner


"Nigel" wrote in message
...
Hi Michael

Try this, it provides a basic framework to develop and meet your exact
needs......

Good Luck
Nigel

add the following to a module in the workbook...........

Public Sub ColourCode()
Dim vQuality As String
Dim vID As String
Dim vRow As Long, vCol As Long

For vRow = 1 To Worksheets("Sheet2").Range("A1").CurrentRegion.Row s.Count
For vCol = 1 To
Worksheets("Sheet2").Range("A1").CurrentRegion.Col umns.Count

vID = Worksheets("Sheet2").Range("A1").CurrentRegion.Cel ls(vRow,
vCol).Value
vQuality = ""
On Error Resume Next
vQuality = Application.WorksheetFunction.VLookup _
(vID, Worksheets("Sheet1").Range("A1").CurrentRegion,
3, 0)
With Worksheets("Sheet2").Range("A1").CurrentRegion.Cel ls(vRow,
vCol).Interior
Select Case vQuality
Case "Good": .ColorIndex = 4: .Pattern = xlSolid
Case "Fair": .ColorIndex = 44: .Pattern = xlSolid
Case "Poor": .ColorIndex = 3: .Pattern = xlSolid
End Select
End With
Next
Next
End Sub


"Michael Koerner" wrote in message
...
I have a workbook with 2 active sheets. Sheet One contains the following
headings


ID No. | Courtesy of | Photo Quality ...
001 Poor
002 Good

Sheet 2 is a grid of numbers from 001 - 1000.

How would I have the background colour for the numbered cells in sheet 2

change
to red (poor) yellow (fair) green (good) to match the ID No. and Photo

quality
from sheet 1?

Any assistance, as always, is greatly appreciated
--

Regards
Michael Koerner







----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000
Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---