Тёмный

Copy Specific Files or All Files from Source Folder to Destination Folder with VBA 

Dinesh Kumar Takyar
Подписаться 115 тыс.
Просмотров 55 тыс.
50% 1

How to copy specific files or all files from source folder to destination folder with VBA.
At 8.01 the code for the message box should be:
MsgBox destinationPath & " does not exist" and not sourcePath!
VBA code and other details available at: www.exceltrainingvideos.com/c...

Опубликовано:

 

19 авг 2017

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 111   
@thimmithim
@thimmithim 5 лет назад
After googling for hours, yours was the most helpful to accomplish the goal I wanted to reach. Thank you for sharing Dinesh.
@juanpaolo21yt
@juanpaolo21yt Год назад
whenever I see ur name or channel In the search results, you are my first pick. most of the time, you answered my question. Just like now. MANY THANKS TO YOU DINESH! from Manila PH
@aset012585
@aset012585 4 года назад
Thank you. It’s working perfectly.
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
Welcome! Please share the VBA tutorial with your friends too.
@drm9514
@drm9514 5 лет назад
Very Useful. Thanks Dinesh
@chandrasekharsrinivas9887
@chandrasekharsrinivas9887 6 лет назад
Hi sir good morning very nice video and more helpful to us, thank you
@ranajsingh
@ranajsingh 4 года назад
Thanks sir, this code helped me a lot.
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
Glad to hear that! Please share the VBA tutorial with your friends.
@mechsparks
@mechsparks 4 года назад
Thank u for the video...very helpful
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
Please share with your friends and on social media. You can view more videos in Hindi and English at www.exceltrainingvideos.com/
@charlesdawnbeltran9603
@charlesdawnbeltran9603 5 лет назад
Thank you for the very useful video sir. I just want to ask if it's possible to manually select the file/s that you want to copy instead of copying it automatically?
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
Yes, of course!
@priyanka1991ism
@priyanka1991ism 5 лет назад
Thank You for the video, I have to copy the excel file to multiple destination paths (paths are mentioned in an excel sheet)
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
This link will help: www.exceltrainingvideos.com/automating-new-report-creation-from-updated-raw-data/
@mohdqasm6946
@mohdqasm6946 2 года назад
Have you found a way to move these files? I have the same issue. I have to copy the excel file to multiple destination paths
@aset012585
@aset012585 4 года назад
Hello, thank you for your video. Its working on my first macro run. but im just wondering, if i need to re-run the macro daily to copy the new files from source folder, will it still copy those files already copied from first macro run? Will it overwrite the files on my second macro run?
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
That will depend on the logic of your macro. You can clear the contents of the worksheet before copying according to your requirements. This web link will guide: www.exceltrainingvideos.com/transfer-specific-data-from-one-worksheet-to-another-for-reports/
@ALEXSHUNCAI
@ALEXSHUNCAI 9 месяцев назад
what if I want to transfer multiple files according to the "Date Modified" to a specific folder? Are there any examples I can share with? Thanks, by the way, good video on this matter.
@saravananbe19
@saravananbe19 6 лет назад
Sir any book u written or u have regarding vba program . I need examples with vba program pls help
@link_2_learn
@link_2_learn 4 года назад
hello sir i like your vba videos. I just want to confirm. if i want to copy all folder and its contents which syntax i should use? and is there way compare files folder and file which have already been transferred to destination?
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
This link will help: www.rondebruin.nl/win/section3.htm
@Manas1990_Vlogs
@Manas1990_Vlogs 6 лет назад
Very nice video sir .. can you make a video on the soap request sending using Vba or excel
@Apollo-ok2to
@Apollo-ok2to 3 года назад
Can we have the specific files based on file names instead of extension? Like storing the specific list in excel and based on the list, it selects, copies or cuts and pastes those specific files into destination folder?
@Exceltrainingvideos
@Exceltrainingvideos 3 года назад
That should be easier for files with specific names.
@sudheerkonjarla930
@sudheerkonjarla930 5 лет назад
Thanks for usful Vedio sir. Can we paste the souce file and destinaion path in message box instead of vba code? if yes, please help me how to do that. Thanks in advance
@debrasavoie1446
@debrasavoie1446 4 года назад
Thank you. I learned quite a bit. I am trying to use Access VBA to use a field name in a table to use as the file name as I have many of same type, but only need certain ones each month. Can you help.
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
Glad it helped!
@venkatamahesh6142
@venkatamahesh6142 4 года назад
Hi Dinesh i liked the video you have presented but i have an issue with my source folders which are presented on the network share drive and i should copy all these files will the help of multiple hyperlinks since i have different multiple hyperlinks as source folder. could you help me out in this
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
I don't understand your question.
@user-nm4ul6gr6o
@user-nm4ul6gr6o 5 лет назад
Thanks ... Thanks ... Thanks
@anhnhatnguyet4628
@anhnhatnguyet4628 3 года назад
copy multiple files in 1 directory to many other folders. When running the code, a scan message box appears, select the address containing multiple destination folders, ok, a message box appears to select files to copy, you can select 1 or more files. Do you have any vba code that can execute something like this description?
@Exceltrainingvideos
@Exceltrainingvideos 3 года назад
Try this: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-i6vXDDDeV1w.html
@rakhisaxena4352
@rakhisaxena4352 4 года назад
Thank you
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
Thanks. Please share with your friends and on social media. You can view more videos in Hindi and English at www.exceltrainingvideos.com/
@SHANKAR_328
@SHANKAR_328 9 месяцев назад
can you please help me make a drag and drop UI to copy a specific files in excel.
@swarupapatil661
@swarupapatil661 Год назад
Sir, I want to copy or move files from any source folder to any destination folder. If i will create list in excel i.e file name, source folder, destination folder. File Name Soruce Folder Destination Folder 1.xls D:\Test E:\Test\Final 2.xlsx C:\Arun D:\Final\Report . .and so on so list ke hisab se A column kee file Source folder se Destination folder mai move hogi kya?
@viswanathponne
@viswanathponne 2 года назад
Thank you sir
@Exceltrainingvideos
@Exceltrainingvideos 2 года назад
Welcome. Please share my channel with your friends.
@shashikalagangappa4735
@shashikalagangappa4735 6 лет назад
hi sir good morning kindly confirm how to edit subject line in recorded macro
@shanthichinni-uz1cx
@shanthichinni-uz1cx Год назад
Thankyou for the video sir... Can we copy files bases on today date modified
@BD_Monk
@BD_Monk 5 лет назад
Hi Sir, Can you please help me. I'm writing my problem below. Say suppose I have a excel file where in A column there is some folder names say 1234, 2345, 3456, 4567 and so on. And in the B column we have output folder names say home, field, road, jungle. So, 1234 folder will get copied to home folder 2345 folder will get copied to field folder and so on. And all the A column data will be in a dump folder. How will I create it. Please help
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
Search www.exceltrainingvideos.com
@jojocarrillo
@jojocarrillo 3 года назад
how can i copy files from folders that only have partial names in a list in excel? The sourcepath is not fully defined as example the excel list only shows WF-002232 R0 but the full path is WF-002232 R0 C2-L11 Facade Cast in Channel layout.
@Exceltrainingvideos
@Exceltrainingvideos 3 года назад
You can use wildcard characters as shown in this video: www.exceltrainingvideos.com/how-to-transfer-data-from-one-sheet-to-another-using-wild-card-characters/
@brantzhang3950
@brantzhang3950 2 года назад
Hi sir, really helpful video, thanks for sharing with us, have one question; I wanna move the specific PDF (file name contains risk rating) how can I add this ?
@Exceltrainingvideos
@Exceltrainingvideos 2 года назад
Just like you learnt in the tutorial. You can also use 'move'.
@MR-ql9eb
@MR-ql9eb 2 года назад
@@Exceltrainingvideos sir, I am trying to combine PDFs in a Folder with names (for example 123456_1, 123456_2, 234567_1, 234567_2, 345678_1, 345678_2). I want to combine 123456 prefix named PDFs as one set to merge and 234567 prefix named PDFs as one set, and so on. There are many sets in the Folder. I want a automate tool or app or excel macro to complete my job at a glance. Please help on this. Thank you.
@kunalkshirsagar3798
@kunalkshirsagar3798 Год назад
@@MR-ql9eb hi, I am also working on similar task, did you find any solution, can you please share?
@Artistram3d1
@Artistram3d1 2 года назад
This is SO powerful!. What should a person study if they wanted to learn more on this subject? I'm no coder, but I'm willing to learn this to help me at work, to copy .pdf files from individual folders (sometimes over 100) into a folder named _PROOFS. I work on a Mac, is the workflow any different? Bless you for sharing your expertise.
@Exceltrainingvideos
@Exceltrainingvideos 2 года назад
This link will make it easier to work on a Mac: www.macexcel.com/examples/filesandfolders/copyfile/
@Artistram3d1
@Artistram3d1 2 года назад
@@Exceltrainingvideos Thank you, Guru!
@divyamitsonkar944
@divyamitsonkar944 6 лет назад
Sir please provide vedio to create many folders into many zip files.Thank you
@saikrishnamandala7667
@saikrishnamandala7667 4 года назад
Hi Sir, I need your help to automate the below query. I receive files with different project names on a daily basis and I have to move them manually to other subfolders (target) based on project name. Example: Files in Source Folder 123 234 567 Folders in Destination Folder 123 234 567 I have to move these files to destination subfolders based on file name. Thanks in advance.
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
There are many ways of to copy or move files from one folder to another. A good method is described here: www.exceltrainingvideos.com/copy-specific-files-from-folder-and-subfolders-into-destination-folder/ It's a good idea to do some research yourself on this channel or our website www.exceltrainingvideos.com
@360prashant1
@360prashant1 4 года назад
Dear sir, i have already tried this code . but i need to copy paste only specific files base on the file names mentioned in excel. please help me with this
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
This link will help: www.exceltrainingvideos.com/copy-specific-files-from-folder-and-subfolders-into-destination-folder/ Change the IF condition to your requirements.
@accnotech3863
@accnotech3863 6 лет назад
Sir, Thankyou So much, I just needed these codes so badly, but there are two doubts, First , What if I want to copy only a specific file, and secondly my destination folder be always a new folder having current date as name of this new destination folder. i am going to use these codes as to get backup of my vba project.... Please share codes for these two doubts Sir.
@Exceltrainingvideos
@Exceltrainingvideos 6 лет назад
Maybe in the next videos.
@shadop5399
@shadop5399 4 года назад
Thank you sir for this valuable information but can we copy excel or doc based on the file name i'll mentioned in cell of a excel, like I want to copy a file name with File name 1 : Dinesh, File name 2 : Kumar, File name 1 : Takyar
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
Yes.
@praveenj000
@praveenj000 5 лет назад
thanks for your video, i have a 2 questing please find below. 1)for source path and destination path can we refer the cell in the excel? instead of writing the full path in the code. if i paste the path in the cell. 2) if my folder is a shared folder how can i define the source path in a code. kindly educate me with the sample code thanks in advance.
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
1) Yes 2) Try path to the shared folder
@user-cs7th6ud8g
@user-cs7th6ud8g 5 лет назад
hi , currently im facing this problem too. may i know how u define the path for a shared folder . highly appreciate your help.
@InsideMyWall
@InsideMyWall 2 года назад
How to browse a folder or file via Excel VBA, copy the name of the file and paste it in a specified word file and export as pdf??
@liuwayne9686
@liuwayne9686 5 лет назад
Hi Sir, I don't think this is copying specific files, what if I want *xxx*.xlx, for example there are many excel files and I only want to copy 2 specific files, can we actually do that using VBA?
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
What is *xxx*.xlx?
@satyenpurohit3947
@satyenpurohit3947 6 лет назад
What if we want to copy active workbook (work book which is already open) to destination folder
@Exceltrainingvideos
@Exceltrainingvideos 6 лет назад
You can't copy an open file. Since you're most probably working on it, you can save it.
@satyenpurohit3947
@satyenpurohit3947 6 лет назад
Dinesh Kumar Takyar , Sir, so you mean we have use save as function to copy that file to destination folder
@apoorvadhoot8493
@apoorvadhoot8493 5 лет назад
The title states copying specific files. But you are copying all files in this video. I still don't understand how to copy specific files. My source folder has 100s of files and i only want 5. Can you please clarify.
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
The title is: Copy Specific Files or All Files from Source Folder to Destination Folder with VBA This link will help: www.exceltrainingvideos.com/copy-specific-files-or-all-files-from-source-folder-to-destination-folder-with-vba/
@dwaipayandattaroy457
@dwaipayandattaroy457 5 лет назад
Hi Sir, How can I copy a file from remote machine to local machine using macro
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
If you have the rights to log on to the remote machine and access the file you should be able to copy the data in the usual manner.
@pmditindia8694
@pmditindia8694 5 лет назад
i am getting Runtime error 424 Object Required. how can i fix it
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
Check your code carefully. This link will help: www.exceltrainingvideos.com/copy-specific-files-or-all-files-from-source-folder-to-destination-folder-with-vba/
@karthikeyanpushparaj8709
@karthikeyanpushparaj8709 4 года назад
Hi sir, above extract only xlm files, what should do for extract all type of files.
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
Watch the video and refer to www.exceltrainingvideos.com/copy-specific-files-or-all-files-from-source-folder-to-destination-folder-with-vba/
@karthikeyanpushparaj8709
@karthikeyanpushparaj8709 4 года назад
Thanks you sir, how to remove temp files, while copying file names in a folder.
@ibrahim_099
@ibrahim_099 2 года назад
Can you do it for MS Access please ?
@hemantsingh2101
@hemantsingh2101 6 лет назад
Hello Sir, I'm a learner and I want to know if you have any video for excel formulas, because I have not good knowledge of formulas I mean how to use or work or formulas, actually I know many formulas but I'm not good to use them I am not good to know that which formulas I have to use and where it can work..Please send me link if there is any video about my query and also I want learn how make a good and beautiful dashboard...please help.Excuse for any mistake bcoz my English is not good.Thank you Sir :-)
@Exceltrainingvideos
@Exceltrainingvideos 6 лет назад
Visit www.familycomputerclub.com or www.exceltrainingvideos.com
@hemantsingh2101
@hemantsingh2101 6 лет назад
Dinesh Kumar Takyar thank you Sir
@mayur_7
@mayur_7 3 года назад
Sir pls tell how to transfer specific sub folders to destination folder
@Exceltrainingvideos
@Exceltrainingvideos 3 года назад
www.exceltrainingvideos.com/copy-specific-files-from-folder-and-subfolders-into-destination-folder/
@sudarshanpotle1582
@sudarshanpotle1582 4 года назад
Hello Sir As I have given path of a folder from my Desktop But still I m getting Run Time Error 76 : Path Not Found sourcePath = "C:\Users\EM-PC1\Desktop\REPORTS" destinationPath = "C:\Users\EM-PC1\Desktop\New folder\"
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
Isn't something missing in your source path?
@sudarshanpotle1582
@sudarshanpotle1582 4 года назад
@@Exceltrainingvideos no nothing I cross checked it and even copy pasted the path
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
Did you use this part of the code: If Right(sourcePath, 1) “\” Then sourcePath = sourcePath & “\” End If If not, then your sourcepath needs correction with a "\",
@sudarshanpotle1582
@sudarshanpotle1582 4 года назад
@@Exceltrainingvideos yes I have taken your code as it is, just changed the source and destination path nothing else changed
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
"I have given path of a folder from my Desktop": the path should look like this - C:\Users\yourname\Desktop...
@TheJITESHMALLI
@TheJITESHMALLI 4 года назад
Getting "runtime error:70 , permission denied" when trying to copy a specific file
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
The file might be password protected.
@TheJITESHMALLI
@TheJITESHMALLI 4 года назад
@@Exceltrainingvideos No, i tried with normal .rar and .xlsx files and got the same error but when i used file extn. ".xlsx", all the files got transferred. So the issue is particularly when i am trying to transfer a specific file.
@harithav4799
@harithav4799 4 года назад
Sir i want to coy all the file not only.xl files how to do sir
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
Use wild card characters like *.*
@jeffgeofrey4140
@jeffgeofrey4140 3 года назад
Hi sir, I have a list of folder name in excel file, Excel file cell value have some data which is same as the source folder name, In source folder there are many folders are there, But I required only few which is available in the excel file to another destination... Is this VBA is helpful??? Please support sir...
@Exceltrainingvideos
@Exceltrainingvideos 3 года назад
Yes. For the folder name(s) you can assign the Range or Cell.
@jeffgeofrey4140
@jeffgeofrey4140 3 года назад
@@Exceltrainingvideos Hi To asign the cell at where???? Any idea. Please help.
@jeffgeofrey4140
@jeffgeofrey4140 3 года назад
Hi sir Any update on this.?
@Exceltrainingvideos
@Exceltrainingvideos 3 года назад
These links will guide: www.exceltrainingvideos.com/save-excel-files-automatically-using-cell-data/ www.exceltrainingvideos.com/refer-cells-using-index-numbers-vba/ www.exceltrainingvideos.com/refer-to-excel-cells-using-range-object/
@ThinkLikeMystic
@ThinkLikeMystic 4 года назад
Object doesn't support this property the error I am getting
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
Before you start using the File Object System or FSO in VBA you need to activate a reference of Microsoft Scripting Runtime Library : www.exceltrainingvideos.com/copy-specific-files-or-all-files-from-source-folder-to-destination-folder-with-vba/
@vikkysharma473
@vikkysharma473 4 года назад
In column A I have file name In column B I have source folder In column C i have destination folder Need a macro To copy files of column A From source path (columnB) To destination path (columnC)
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
You just saw the video to solve the problem. This link will help further: www.exceltrainingvideos.com/copy-specific-files-or-all-files-from-source-folder-to-destination-folder-with-vba/
@mahmartins7602
@mahmartins7602 4 года назад
I have a code to do that, send do different destinations, but now they are hardcoded. I am still looking for a code to read from the main table where is the destination of each file
Далее
How to display files in folder with VBA
6:40
Просмотров 8 тыс.
Move or Copy List of Files
14:38
Просмотров 2,5 тыс.
I Built 100 Homes And Gave Them Away!
09:36
Просмотров 36 млн
VLOOKUP MATCH from another workbook - VBA
30:06
Просмотров 3,7 тыс.
VBA to BROWSE & COPY Data from SELECTED File in Excel
10:00
VBA Macro to Copy Data from Another Workbook in Excel
13:39