PDA

View Full Version : Moving Several Files To Several Folders



galang_ofel
05-10-2013, 08:17 AM
Hi,
I need a code to move several files to several folders, I already created one but need to enhance it to avoid encountering "run time error 53" when content(files) of the code is not present in the folder.
My requirement will be account and destination folder should be harcoded.

Thanks in advance.

ofel

Excel Fox
05-10-2013, 09:44 PM
Then why don't you just write a line at the start
On Error Resume Next

snb
05-11-2013, 03:41 PM
sub M_snb()
c00 = "C:\TEST\"
c01= "C:\Documents and Settings\roblesjv\Desktop\SOA RAW DATA\JEMS SOA 2013\SOA MAY 2013\"

if Dir (c00 & "134783000011*.txt")<>"" then name c00 & Dir (c00 & "134783000011*.txt") As c01 & "PNB DUBAI RO\USD -134783000011"
End Sub

galang_ofel
06-01-2013, 04:21 PM
Hi,
Thanks a lot problem solved by adding on "error resume next" in the first line of the code

regards