VBA Copying Files

titoexcel

Board Regular
Joined
Mar 26, 2013
Messages
55
Hi,

I am fairly new to VBA and just now reading books and practicing. I have been asked to help build a macro that will do the following:

Zip File inbound - we will get a zipfile of bank statements about 500 statements. Each file has a unique account number
  • I want to copy each one of these files to specific locations on shared drive.
    • So if file name is 123323act. I want to copy this file and put it in a folder that has that account number as unique identifier.
      • we would have about 500 of these files on monthly basis.
      • Also, i am not sure the process would be if we were to add one more file so it would be 501 and how macro will pick that up and place in the correct folder?
      • Any help would be greatly appreciated. I can provide what i started but its not much.

Regards,

Tito
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Here is code for you to inspect and experiment with:

Code:
Sub wigi()    
    c00 = "C:\Users\tm1user2\Downloads\" 'SOURCE FOLDER
    c01 = "C:\Wim\" 'TARGET FOLDER
    
    On Error Resume Next
    
    file = Dir(c00 & "*")
    While (file <> "")
            vFilename = CreateObject("scripting.filesystemobject").GetBaseName(c00 & file)
            MkDir c01 & vFilename
            FileCopy c00 & file, c01 & vFilename & "\" & file
    file = Dir
    Wend


End Sub
 
Upvote 0
Any update to my post please?
 
Upvote 0

Forum statistics

Threads
1,223,714
Messages
6,174,052
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top