Copy Single file to multiple destination in easy way...?

miqbal

New Member
Joined
Mar 7, 2018
Messages
11
Hi,

I want to backup my log workbook to multiple locations. How can i do it in simple way.?

right now i only back to one location and here is my code. I am not a programmer but by seeing different posts i created this "sub".


[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Sub BackupTaskInfo()[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]
FileCopy "X:\Startup\Tasks Info_2018.xlsx", "U:\Tasks Report\Tasks Info_2018.xlsx"[/FONT]

[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]
End Sub[/FONT]



the above copy file to only 1 location "U:\Tasks Report" but I want to save it 2nd location also which is "U:\Backup".
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
No VBA expert but if the above works
just repeat the FileCopy line of code within the sub with and supply a different destination
 
Upvote 0
Just add a second similar line under the first one, i.e.
Code:
[B]FileCopy "X:\Startup\Tasks Info_2018.xlsx", "U:\Backup\Tasks Info_2018.xlsx"[/B]
 
Upvote 0
I thought there will be function like FileCopy whicb i can use to add multiple destinations in a single line of code.. but thnx alot the above suggestion of pros works great.
 
Upvote 0
I thought there will be function like FileCopy whicb i can use to add multiple destinations in a single line of code
I don't think there is, though you could create your own function (UDF) in VBA to do it.
That might be worth it if you were going to re-use it a bunch of time in your code, but if it is only to copy over one file two teams, I would say it really isn't worth the extra effort.
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,143
Members
453,021
Latest member
Justyna P

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