Hi!
I was trying to check the file name in 2 column.
And if it duplicate it should be mark green. and if it not duplicate it should be mark red.
something like this.
a.xlm b.xlm<---- green
b.xlm a.xlm<---- green
c.xlm <-----red
but it marks every file name with gren. it should be about 60 rows with red.
thx in advance
I was trying to check the file name in 2 column.
And if it duplicate it should be mark green. and if it not duplicate it should be mark red.
something like this.
a.xlm b.xlm<---- green
b.xlm a.xlm<---- green
c.xlm <-----red
but it marks every file name with gren. it should be about 60 rows with red.
Code:
Sub SubControll()
Dim ws As Worksheet
Dim i As Integer
Set ws = ThisWorkbook.Sheets("Controll")
For i = 2 To ws.range("B2").End(xlDown).row
Exist ws, ws.Cells(i, 2)
Next i
End Sub
Sub Exist(ws As Worksheet, Name As String)
Dim i As Long
For i = 2 To ws.range("A2").End(xlDown).row
If Name = ws.Cells(i, 1) Then
ws.Cells(i, 1).Interior.ColorIndex = 3
Else
ws.Cells(i, 1).Interior.ColorIndex = 4
End If
Next i
End Sub
thx in advance
Last edited: