Sub ListFiles()
Dim MyFolder As String
Dim MyFile As String
Dim j As Integer
MyFolder = "C:\example"
MyFile = Dir(MyFolder & "\*.xls")
Do While MyFile <> ""
j = j + 1
Cells(j, 1).Value = MyFile
MyFile = Dir
Loop
End Sub
Sub doloop()
Dim rw As Integer
rw = 4
Do Until rw = 34
If Cells(rw,1).Value > 0 Then
Cells (rw, 2).Interior.Color = vbGreen
ElseIf Cells(rw,1).Value < 0 Then
Cells (rw, 2).interior.Color = vbRed
End If
rw = rw + 1
Loop
End Sub
That's interesting... did you edit this after pasting it into the message?Rich (BB code):Cells (rw, 2).Interior.Color = vbGreen ElseIf Cells(rw,1).Value < 0 Then Cells (rw, 2).interior.Color = vbRed
There is certainly an ElseIf in VBA, Brandon.