The code works for me. What exact error are you getting?
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"rwnelson" wrote in message
oups.com...
Sorry, I posted the wrong code. When I run this code as is,
the SELECT
CASE line gives me an error.
'-----------------------------------------------------------------------
Sub doRange(rngTopLeft As Range)
With rngTopLeft.Resize(7, 2)
If rngTopLeft.Value < Date Then
.Interior.Pattern = xlGray50
Else
.Interior.Pattern = xlSolid
End If
If rngTopLeft.Value = 1 And rngTopLeft.Interior.ColorIndex
= 15
Then
Select Case Weekday(rngTopLeft.Value)
Case 1, 7 'Sunday or saturday
.Interior.ColorIndex = 37
Case Else
.Interior.ColorIndex = 40
End Select
End If
If rngTopLeft.Value = "" Then
.Interior.ColorIndex = 15
End If
End With
End Sub
'-------------------------------------------------------------------------