so far this is the code i have:
Private Sub Worksheet_Change_C(ByVal Target As Range)
If Target.Row = 1 Then Exit Sub
On Error GoTo ErrHandler
Application.ScreenUpdating = False
Dim myDataRng As Range
Dim cell As Range
Set myDataRng = Range("B1:B" & Cells(Rows.Count, "B").End(xlUp).Row)
For Each cell In myDataRng
cell.Offset(0, 0).Font.Color = vbBlack
If Application.Evaluate("COUNTIF(" & myDataRng.Address & "," & cell.Address & ")") > 1 Then
cell.Offset(0, 0).Font.Color = vbRed
End If
Next cell
Set myDataRng = Nothing
ErrHandler:
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
i need the code to check column F to see if a corresponding cell is true or false or i need it to check the next duplicate range to see if the cells exactly match. basically if the b column if a duplicate i need it to see if 2 cells to the right has a date input and if it does then the duplicate is not a true duplicate to not turn it red. i'm not even sure if this is possible
Private Sub Worksheet_Change_C(ByVal Target As Range)
If Target.Row = 1 Then Exit Sub
On Error GoTo ErrHandler
Application.ScreenUpdating = False
Dim myDataRng As Range
Dim cell As Range
Set myDataRng = Range("B1:B" & Cells(Rows.Count, "B").End(xlUp).Row)
For Each cell In myDataRng
cell.Offset(0, 0).Font.Color = vbBlack
If Application.Evaluate("COUNTIF(" & myDataRng.Address & "," & cell.Address & ")") > 1 Then
cell.Offset(0, 0).Font.Color = vbRed
End If
Next cell
Set myDataRng = Nothing
ErrHandler:
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
i need the code to check column F to see if a corresponding cell is true or false or i need it to check the next duplicate range to see if the cells exactly match. basically if the b column if a duplicate i need it to see if 2 cells to the right has a date input and if it does then the duplicate is not a true duplicate to not turn it red. i'm not even sure if this is possible