Hello Matt,
Sorry for the late reply. My ISP was down for about 9 hours today. I create 2 example workbooks based on your information. A macro is attached to the button on "Sheet1" of "Weekly Book 2". This colors the hotels based on the percentages taken from "Master Book 1". The names of the workbooks, and worksheets can be changed to what you are using. This is just an example so we can get moving in the right direction.
Sub ColorByPercentage()
Dim Cell As Range
Dim CI As Long
Dim DSO As Object
Dim DstRng As Range
Dim DstWkb As Workbook
Dim Key As Variant
Dim Keys As Object
Dim RngEnd As Range
Dim SrcRng As Range
Dim SrcWkb As Workbook
Set DstWkb = ThisWorkbook
Set SrcWkb = Workbooks("Master Book 1.xls")
Set DstRng = DstWkb.Worksheets("Sheet1").Range("A2")
Set RngEnd = DstRng.Parent.Cells(Rows.Count, DstRng.Column).End(xlUp)
Set DstRng = IIf(RngEnd.Row < DstRng.Row, DstRng, DstRng.Parent.Range(DstRng, RngEnd))
Set SrcRng = SrcWkb.Worksheets("Sheet1").Range("A2")
Set RngEnd = SrcRng.Parent.Cells(Rows.Count, SrcRng.Column).End(xlUp)
Set SrcRng = IIf(RngEnd.Row < SrcRng.Row, SrcRng, SrcRng.Parent.Range(SrcRng, RngEnd))
Set DSO = CreateObject("Scripting.Dictionary")
DSO.CompareMode = vbTextCompare
For Each Cell In SrcRng
Key = Trim(Cell.Text)
Item = Cell.Offset(0, 1).Value
If Key <> "" Then
If Not DSO.Exists(Key) Then
DSO.Add Key, Item
End If
End If
Next Cell
For Each Cell In DstRng
Key = Trim(Cell.Text)
If DSO.Exists(Key) Then
Select Case DSO(Key) * 100
Case 0 To 30
CI = 3 'Red
Case 31 To 70
CI = 6 'Yellow
Case 71 To 100
CI = 5 'Green
End Select
Cell.Resize(1, 7).Interior.ColorIndex = CI
End If
Next Cell
Set DSO = Nothing
End Sub
Bookmarks