PDA

View Full Version : Copying & pasting the Data from Multiple sources to corresponding multiple destinatio



ajaysnarp
02-20-2014, 12:08 PM
Happy Thursday!

First & Foremost Thank You! for looking into this post out of your busy schedule.

My sincere request to help me on the below macro.

Please Note that i did happened to perform a research but i am getting help on Copying & pasting the Files from One folder to another folder whereas i have a different criteria because of which i am seeking help.

----------------------------------------------------------------------------------------------
This is with regard to Copying the latest file from one location to another location based on the path (source & destination) provided in the attached excel file.

Please note that the path would be updated in the excel cells & i would be inserting a command button for the code to look into the each of the source file i.e path mentioned in column A, Copy the Latest Saved file from that specific folder & then Copy the same to the corresponding Destination folder i.e path mentioned inn Column B.

Once the File gets copied to the destination folder a comment can be updated in column C mentioning "File Copied successfully".

There will be one unique scenario for example i will be executing the above task for the first time this week & all the Latest files from each of the source files will get copied to the corresponding destination folder.

when i am running the macro next week assuming there are NEW files that have got saved in the folders 1,2,4 in this scenario the macro will copy the Latest files from the source to the destination folder.

whereas assuming there are NO new files that have got saved folders 3 & 4, in this scenario the macro will treat the latest file (the one that was already copied & pasted last week) & copy & paste to the destination folder, while pasting since it is pasting the same old weeks file that was already saved, it should NOT overwrite instead it should come out of the loop & update a comment mentioning "Not Latest File Available".

Thanks a lot for all your help in advance!!

Jomathr
02-20-2014, 01:53 PM
Hello,

I checked your file and there is no code at all in it, personaly I rather not give out the full code since some ppl(such as myself) are paid to create apps/macro but I will give you a few pointers on what you will need

copyfile: http://msdn.microsoft.com/en-us/library/aa265015(v=vs.60).aspx
A Loop to check for all files in directory : http://www.learn.net.au/vba/vba-loops
Worksheets() and range() : http://msdn.microsoft.com/en-us/library/office/aa139976(v=office.10).aspx

When you come up with some codes for what you want to do I will gladly help you, or you can hope someone is generous enough to do the work for you