rnordquest
New member
- Jul 17, 2003
- 148
How do I get an Excel macro to transfer a file from one folder to another without opening it? I want it to work with all filetypes. I tried moving some PDF files and they don't open correctly. Here's what I did:
fromPath = Range("F12").Value
toPath = Range("F17").Value
Range("A1").Select
For i = 1 To endRow
FileName = ActiveCell.Value
If FileName = "" Then GoTo Found
On Error GoTo NotFound
Workbooks.Open FileName:=fromPath & FileName
Workbooks(FileName).SaveAs FileName:=toPath & FileName
Workbooks(FileName).Close SaveChanges:=False
GoTo Found
fromPath = Range("F12").Value
toPath = Range("F17").Value
Range("A1").Select
For i = 1 To endRow
FileName = ActiveCell.Value
If FileName = "" Then GoTo Found
On Error GoTo NotFound
Workbooks.Open FileName:=fromPath & FileName
Workbooks(FileName).SaveAs FileName:=toPath & FileName
Workbooks(FileName).Close SaveChanges:=False
GoTo Found