Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete all Excel workbooks from a list on worksheet on condition.
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete all Excel workbooks from a list on worksheet on condition.
Brilliant, and thank you again. I was cooking something much more
convoluted. How would have it been different if path was in Column A, file name in Column B, Type in Column C and Delete in Column D ? Sub killem() On Error Resume Next For Each fn In Range("A2:A22") If UCase(fn.Offset(, 4)) = "Y" Then fn = fn..text + fn.Offset(, 1).text +fn.Offset(, 2).text Kill fn End If Next fn End Sub Would t6hat syntax be correct ? Thank you again, J.P. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to delete an excel line based on a condition | Excel Worksheet Functions | |||
Delete worksheet row based on condition | Excel Programming | |||
Delete Worksheet Condition | Excel Programming | |||
How to delete Excel worksheet using VBA without delete dialog? | Excel Programming | |||
Generating a report list and statistic worksheet in Excel from other workbooks | Excel Discussion (Misc queries) |