LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 
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 multiple files? Adnan Excel Discussion (Misc queries) 0 May 6th 09 05:31 PM
Cannot Delete Archived TMP Files Bob English[_2_] Excel Discussion (Misc queries) 0 March 3rd 09 08:13 PM
Delete Blank Rows Code - Multiple Worksheets - Multiple Documents BenS Excel Discussion (Misc queries) 3 June 29th 07 12:20 AM
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 05:34 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"