Delete all Excel workbooks from a list on worksheet on condition.
On Jul 27, 11:21*am, u473 wrote:
I need monthly to loop and delete all workbooks listed in column A,
*(full path and file name is given) where column B content = "Y"
A * * * * * * * * * * * * * * * * * *B
File * * * * * * * * * * * * * *Delete
C:\Progress\ProjA.xls * * * *Y
C:\Progress\ProjB.xls
F:\Perf /ProjA\Elec.xls
F:\Perf /ProjA\Equip.xls * * Y
Help appreciated
J.P.
Sub killem()
On Error Resume Next
For Each fn In Range("A2:A22")
If UCase(fn.Offset(, 1)) = "Y" Then Kill fn
End If
Next fn
End Sub
|