Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 59
Default How to delete multiple files?

Hi to all,

Could anyone please tell me as to why the following code won't work?


Sub LargoFiles()

Dim lRow As Long
Dim i As Long
Dim myFName As String

With ActiveSheet
lRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With

On Error Resume Next

For i = 3 To lRow
If Cells(i, 1).Value = "x" Then
myFName = Cells(i, 2).Value
Kill myFName ' delete files specified with an x
RmDir Cells(i, 1).Value 'delete the folder also
if it's empty
Cells(i, 1).Value = "Deleted" 'mark row as deleted
End If
Next i

On Error GoTo 0

End Sub



Would appreciate any help provided,
Adnan
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete archived tmp files Bob English Excel Discussion (Misc queries) 0 December 19th 08 08:32 PM
Delete Blank Rows Code - Multiple Worksheets - Multiple Documents BenS Excel Discussion (Misc queries) 3 June 29th 07 12:20 AM
Excel will not delete the tmp files. vmoakley Excel Discussion (Misc queries) 1 November 23rd 05 11:02 PM
view multiple files in multiple windows on multiple screens. tcom Excel Discussion (Misc queries) 7 September 15th 05 09:35 PM
How can I view files chronologically when opening multiple files Stevilsize Excel Discussion (Misc queries) 3 July 26th 05 12:49 AM


All times are GMT +1. The time now is 06:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"