Hi
The below only executes on the first file within the applicable folder and am wondering if someone could help me with this please kindly?
I need it to loop through all open files and apply the stated formulas.
Thanks
The below only executes on the first file within the applicable folder and am wondering if someone could help me with this please kindly?
I need it to loop through all open files and apply the stated formulas.
VBA Code:
Dim MyFolder As String
Dim MyFile As String
Dim WB As Workbook
Application.ScreenUpdating = False
MyFolder = "\\Test\Data\" & Range("A1")
MyFile = Dir(MyFolder & "\*.xls")
Do While MyFile <> ""
Workbooks.Open filename:=MyFolder & "\" & MyFile
MyFile = Dir
Loop
For Each WB In Workbooks
If WB.Name <> "AHT" And WB.Name <> "0005*" Then
Lastrow = Range("C" & Rows.Count).End(xlUp).Row
Range("H9").Formula = "=E9-D9"
Range("H9").AutoFill Destination:=Range("H9:H" & Lastrow)
Range("H9:H" & Lastrow).NumberFormat = "hh:mm:ss"
Range("I9").Formula = "=SUMIF(C9:C1000,""CALL FOLLOW UP"",H9:H1000)"
Range("I9").NumberFormat = "hh:mm:ss"
End If
Next
Application.ScreenUpdating = True
Thanks