View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
[email protected] night_writer@att.net is offline
external usenet poster
 
Posts: 7
Default On Error Resume Next question

On Sep 21, 4:39 pm, "Bob Phillips" wrote:
Dim urRows As Integer, urCols As Integer
Dim i As Integer, j As Integer
Dim dType As String

Worksheets("Sheet1").Activate

With ActiveSheet

urRows = .UsedRange.Rows.Count
urCols = .UsedRange.Columns.Count

For i = 1 To urRows
For j = 1 To urCols
With .UsedRange.Cells(i, j)

If .Locked = False Then
.Interior.Color = RGB(255, 255, 153) ' color =
yellow
dType = ""
On Error Resume Next
dType = .Validation.Type
On Error GoTo 0
If dType < "" Then
If .Validation.ShowError = True Then _
.Interior.Color = RGB(255, 204, 153) ' color
= orange
End If
End If
End With
Next j
Next i
End With

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)


Thank you. That does work! And also, for the very first time, I think
I understand how the "With" is supposed to work.

Your example is very concise and easy to follow.

Alice