|
-
May 2nd, 2013, 05:27 AM
#1
Thread Starter
New Member
Move file and create folder
Hi All,
I am kinda new on VBA and I am trying to create a Macro to help me on a project.
I have a 2 collumn Excel file with x rows
A1.value = Filename.ext
B1.value = Full_Folder_Path
On my hard drive, all files (at least most) are under the same root folder C:\S\
I would like the VBA mcro to read the excel file and make the following actions:
Read A1
Move A1 file from root folder S to Path on B2
Loop
Read B2
... Till Ax
Sub copyfiles()
Dim x As Long, a As Long
x = Cells(Rows.Count, 1).End(xlUp).Row
For a = 1 To x
FileCopy "C:\S\" & Cells(a, 1).Value, Cells(a, 2).Value
Next a
End Sub
For some reason this is not working.
Any ideas would be much appreciated.
Thanks !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|