Option
Explicit
Sub
TryIt()
Const
Spalte
As
Long
= 1
Const
Pfad
As
String
= "C:\Temp\"
Dim
x
As
Long
, Treffer
As
Long
Dim
strFile
As
String
x = 1
Do
If
Left(Cells(x, Spalte).Value, 1) =
"r"
Then
strFile = Mid(Cells(x, Spalte).Value, 2, 5) &
"*.jpg"
strFile = Pfad & strFile
If
Len(Dir(strFile)) > 0
Then
Treffer = Treffer + 1
Cells(x, Spalte).Interior.Color = xlColorIndexAutomatic
Else
Cells(x, Spalte).Interior.Color = 65535
End
If
End
If
x = x + 1
Loop
Until
Cells(x, Spalte).Value =
""
MsgBox
"Anzahl "
& Treffer
End
Sub