Как написать код, демонстрирующий, что диапазон от C5 до C24 не пуст, тогда будет учитываться в countFile?
Dim FolderPath As String
Dim Path As String
Dim count As Integer
Dim countFile As Integer
Dim Folder As String
FolderPath = Range("B2")
Path = FolderPath & "\*.xls"
Filename = Dir(Path)
If Folder = vbNullString Then
Range("C2").Interior.ColorIndex = 4
Else
Range("C2").Interior.ColorIndex = 3
End If
Do While Filename <> ""
count = count + 1
Filename = Dir()
Loop
countFile = Application.WorksheetFunction.CountIf(Range("C5:C24") NotIsEmpty)
If count = 6 * countFile - countFile + 1 Then
Range("C2").Interior.ColorIndex = 4
Else
Range("C2").Interior.ColorIndex = 3
End If