Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, I posted the wrong code. When I run this code, the SELECT CASE
line gives me an error. '------------------------------------------------- Sub colors() Dim iRow As Long Dim iCol As Long For iRow = Range("F7").Row To Range("R42").Row Step 7 For iCol = Range("F7").Column To Range("R42").Column Step 2 doRange Cells(iRow, iCol) Next iCol Next iRow End Sub 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Select Case Statement | Excel Worksheet Functions | |||
select case statement | Excel Programming | |||
Select Case Statement does not evaluate | Excel Programming | |||
Convert If..Else to Select Case Statement. | Excel Programming | |||
Data validation with the Select Case statement | Excel Programming |