1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim RangeOfCells As Range
Dim Cell As Range
Dim songname As String
Dim Nom As Range
Dim TotalRow As Long
TotalRow = Range("D" & Rows.Count).End(xlUp).Row
Set RangeOfCells = Range("D2:D" & TotalRow)
' If Not Application.Intersect(Target, Range("A:l")) Is Nothing Then
For Each Cell In RangeOfCells
'edit: include artist
songname = "P:\habiler\" & _
Cell & "\" & Cell.Offset(0, 5) & "_" & Cell.Offset(0, -2) & ".Pdf"
Debug.Print "Checking: " & songname
Cell.Font.Color = IIf(Len(Dir(songname)) > 0, vbRed, vbBlack)
Next Cell
' End If
MsgBox "Done, verify data first time"
End Sub |