Jak
Well-known Member
- Joined
- Apr 5, 2002
- Messages
- 833
Hi all
The code below checks to see if there is a value in column 1 and if true checks to see if the value in column 4 is (A through J). If not then it colours the cell in column 4 with a red background.
The problem I have is that I have a header row. The code highlights cells that do not meet the criteria which will always include Cell D1 . I dont want this to happen. Row 1 is a header row and I need the code to omit row 1. Any assistance with code amendment to exclude row 1 would be great.
The code below checks to see if there is a value in column 1 and if true checks to see if the value in column 4 is (A through J). If not then it colours the cell in column 4 with a red background.
The problem I have is that I have a header row. The code highlights cells that do not meet the criteria which will always include Cell D1 . I dont want this to happen. Row 1 is a header row and I need the code to omit row 1. Any assistance with code amendment to exclude row 1 would be great.
Code:
Sub Error_checker()
For Each c In ActiveSheet.UsedRange.Columns(1).Cells
If Not IsEmpty(c) Then
If IsError(Application.Search(c.Offset(0, 3).Value, "ABCDEFGHIJ")) _
Or IsEmpty(c.Offset(0, 3)) Then
c.Offset(0, 3).Interior.ColorIndex = 3
End If
End If
Next c
Application.ScreenUpdating = True
End Sub