View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
John Keturi John Keturi is offline
external usenet poster
 
Posts: 19
Default Using multiple conditions

The following generates an error "Next" without a "For". What do I put in so
that it formats the cell which corresponds to the following row & column
parameters?

For a = 4 To 31
If Cells(a, 1).Value = "John" Then
For b = 2 To 32
If Cells(2, b).Value = "Fri" Then
Cells(b, a).Select
With Selection.Interior
.ColorIndex = 0
.Pattern = xlGray8
.PatternColorIndex = xlAutomatic
End With
Next b
End If
Next a
MsgBox "Formatting Complete"
Exit Sub
Error:
Exit Sub
End Sub


Thanks