Тёмный

Excel VBA to Combine Multiple Workbooks - Transfer Data from Multiple Excel Files 

Excel Destination
Подписаться 45 тыс.
Просмотров 215 тыс.
50% 1

This tutorial explains how to transfer Data from multiple excel workbooks into one Master File with easy VBA Code.

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

 

1 окт 2018

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 264   
@johnenojardo7160
@johnenojardo7160 2 года назад
Superb just what I need! Many thanks man!
@ExcelDestination
@ExcelDestination 2 года назад
welcome
@JCROD5
@JCROD5 4 года назад
Thanks for the video. It worked beautifully
@ExcelDestination
@ExcelDestination 4 года назад
You're welcome!
@user-nm4ul6gr6o
@user-nm4ul6gr6o 4 года назад
Thank you very much for this great video.
@senthilmuruganm8592
@senthilmuruganm8592 3 месяца назад
Worked like a beauty sir. ❤
@wenkev02
@wenkev02 4 года назад
Do you have a video for this? I do all my estimates on an Excel spreadsheet. The cells that the address goes in is the same for all my saved estimates. I would like to collect the addresses from all my estimates and place it in one file for mailing. Can you help with this?
@LaCarnevali
@LaCarnevali 4 года назад
Hi! Many thanks, this video has been really useful! It would be helpful also to know how to keep table formatting? Thanks :)
@ExcelDestination
@ExcelDestination 4 года назад
Thanks! not sure about keeping table formatting.......but you can write code for any formatting.
@LaCarnevali
@LaCarnevali 4 года назад
@@ExcelDestination Thanks. May I ask you how you define "me" ?
@ExcelDestination
@ExcelDestination 4 года назад
I feel, we don't need to define me.
@Jojosmith342
@Jojosmith342 Год назад
excellent. thank you so much for your valuable lesson. Subscribe and very much liked !
@ExcelDestination
@ExcelDestination Год назад
Thanks 😊
@tuhin9211
@tuhin9211 3 года назад
Hi, This is great to use but I need little help with the code as my data has few missing count of files names can I skip them in the loop. E.g.: The file name is "Search Query Week 6.xlsx" , then Week 7 and 8 is missing then "Search Query Week 9.xlsx" it's one thing i want to know how to jump if the file is not exist. Another thing is my file name ends with 6 to 35, hence should I use "i" as shown in the video or need to do some changes with the code. These 2 queries. I must say the video was very useful. Thanks a lot for this.
@prashantsureshkatkar6189
@prashantsureshkatkar6189 2 года назад
Hi, your video is so helpful to me. But I stuck at one point in raw files after the header I have one black row and after that blank row I have data.. will you please tell me how to edit the code in this condition.. please guide. That will solve my entire problem
@atulojha1132
@atulojha1132 Год назад
Thanks for such video tutorials. Can you please describe how to set file location if details are not be same eg . Dpr -1,2,3... And second thing how to use columnoffset if there is column are not fixed in order.
@abdulhamidalhaddadi2255
@abdulhamidalhaddadi2255 4 года назад
Thank you
@belmondo3330
@belmondo3330 2 года назад
Can we just take particular data from each file? If yes, how we can do that? (For example in this example, we just need column A and column D, can we do that?
@rajadey1552
@rajadey1552 Год назад
Ok if I will go with macro and doing the same things let's replaced the vba codes then what is the results? That will work?
@rakshitharamesh3161
@rakshitharamesh3161 4 года назад
This is really a very helpful video. Although I have a doubt, unlike your case(Day1,2,3), what if the different files is not sequential like(Day 2,29,40)
@ExcelDestination
@ExcelDestination 4 года назад
There could be different logic based on data.
@mxrvxn08
@mxrvxn08 2 года назад
@@ExcelDestination Hi Sir, how about if the name of the file is month? example Jan, Feb, or March. or Location ex, Texas, California?
@saimahmad4302
@saimahmad4302 3 года назад
Thank you for this video and it was really helpful. I am trying to achieve the same thing but instead of pasting everything in first sheet of master file, I want separate sheets of each excel data in the master file. How can I do that? Any help will be appreciated.
@ExcelDestination
@ExcelDestination 3 года назад
Glad it was helpful!
@uday2510
@uday2510 4 года назад
I m dealing with network alarms on daily basis. Getting data in 23 files for different zone. Need to append the data in single sheet for doing further analysis.
@eleanortay2389
@eleanortay2389 3 года назад
In the video you had showed the combining of 5 different files, but what if you had an unknown number of files to combine? e.g. one week is 4 files, the next week is 5 files, the following week is 6 files etc. How do you modify the code for the "For i = 1 To 5 Step 1" part?
@hussainmeghani4809
@hussainmeghani4809 3 года назад
Use do while loop
@sonjilo
@sonjilo 9 месяцев назад
​@@hussainmeghani4809can u explain to me plzz
@DJDEEM1
@DJDEEM1 Год назад
Hello. I recreated your Excel VBA to Combine Multiple Workbooks example shown here and I am receiving a Run-time error '1004': It's look for a file entitled "Day0.xlsx" but that file does not exist. Do you have any suggestion to fix this? Thanks
@Nag1479
@Nag1479 4 месяца назад
This is very helpful, since I am very new to VBA, quite difficult to understand. would it be possible to explain how we have defined the each excel by step by step.
@user-ov3gk9fn6o
@user-ov3gk9fn6o Год назад
hello sir thank you for this valuable lesson , but how can we precise automatically the path of the files and how can we import wokbooks with multiple sheets
@PeggywongPeggy
@PeggywongPeggy 4 года назад
my file it is totally diff, mine is staffs salaries / taxes i need to run for the whole years to file govt tax how to do the run.
@fengfuxu4822
@fengfuxu4822 6 месяцев назад
thank you for the video. I have a question for Printer object and Printers object. is any Reference library required to install in the Tool->Reference before we can use Pinter and Printers object? I run below code, and get error "object is required" for line "For Each prt In Printers". Sub ListPrinters() Dim prt As Printer For Each prt In Printers Debug.Print Prt.deviceName Next prt End Sub
@biswajeetsahoo2487
@biswajeetsahoo2487 2 года назад
What if file has xlxs and xlsm format and i need to open in whatever format file is to consolidate data
@vsbabu123
@vsbabu123 4 года назад
Hi Sir, Could you please help me on VBA code for below scenario..I have a folder which is having multiple files, in that few files having 15 columns of headers and few of files having more than 32 columns of headers,, so if file has 15 columns of headers need to copy as it is and paste into consolidated file, if file has 32 columns of headers need select required columns (up to 15 columns which are having same in 15 columns file but header name will be slight different ..example: if header name in 15 columns of the file has "Subject" but in different file header will be "SubjectID")which was align in between the headers, and paste into same consolidated file next available empty rows,, Thank you so much in advance...
@reeteshism
@reeteshism 4 года назад
Hey there... These codes are very useful. However, is there a possibility that you can tell me how to set up the code or what changes to make in this code shown in the video, if the file names are completely different.
@ExcelDestination
@ExcelDestination 4 года назад
you can give memory in "set" line accordingly. Try out at your end. If you need any help please send me email at EXCELDESTINATION@GMAIL.COM
@yogeshkatre258
@yogeshkatre258 Год назад
I was going through comments the main problem is Me Keyword because of which the code is not working have you any solution for that or no.
@rv99p
@rv99p 4 года назад
thanks for this video.. how to specify if i have more than 5 sheets in a folder. it would be great to know this for my work
@ExcelDestination
@ExcelDestination 4 года назад
Thanks for watching! you can take help from another tutorial at ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-aijlRxa35nw.html
@santyshyam7894
@santyshyam7894 4 года назад
Hi, Thanks for this tutorial........This helps in adding rows but what to do if we have to append coloumn wise......
@ExcelDestination
@ExcelDestination 4 года назад
some additional code
@21Gannu
@21Gannu 3 года назад
@@ExcelDestination and what would that look like
@amithkg4427
@amithkg4427 5 лет назад
Hi sir, I wanted some information.. Like am building one macro.. Please help me for this..
@yemiakinwande7039
@yemiakinwande7039 4 года назад
Thank you for this video. This is helpful. Instead of VBA, is it possible to do this in Excel with Power Query?
@ExcelDestination
@ExcelDestination 4 года назад
Yes, definitely
@vishalthakurcasanova
@vishalthakurcasanova 3 года назад
sir please visit excelisfun channel for PowerQuary they have awesome stuff there !!!
@Sunny_hunny
@Sunny_hunny 4 года назад
Can i fill the details in template through vba?
@catherinelopez1876
@catherinelopez1876 3 года назад
What is the logic for files with inconsistent names?
@ashishmehrotra7308
@ashishmehrotra7308 Год назад
Copy paste coding not written but coding successful 👍
@danishrizwan8304
@danishrizwan8304 2 года назад
I am not that expert in vba hence didn't understood the full code, will encourage you to take time and explain the code (make the audience understand about the code) instead of just reading what you about to type
@DJjeffer92
@DJjeffer92 2 года назад
How can I consolidate specific cells of multiple workbooks into one table in Excel using VBA?
@nittinsakhrani7586
@nittinsakhrani7586 3 года назад
Sir can u help me with this same code just to add. How to work with password protected files
@travelvloggerprosen1460
@travelvloggerprosen1460 Год назад
What to if I have to copy more sheet like sheet2 sheet3 and name of files in different name like date format
@Kunhis
@Kunhis 3 года назад
Dear Sir, Good Job !! i have a similar file, some invoices (same format) sheets in one excel file and i want to add one more sheet like report, specific cells data should be transfer from all invoices to this report sheet. please refer to me any of your video to know about the vba or shall I write to your email. please advise
@indrabhanzanjad9902
@indrabhanzanjad9902 4 года назад
I use this code but very take time console. Please suggest any extra code because my time save & .XLS file not conso any idea.
@amithpoojary4166
@amithpoojary4166 3 года назад
How to copy full data from sheet 3 from file is different folder to master sheet.
@gopalthakur3060
@gopalthakur3060 13 дней назад
What will be the code if the nunber of excel file is keep on adding in the folder, and it not fixed number of excel files. Please guide, thanks!
@PeggywongPeggy
@PeggywongPeggy 4 года назад
do you have the short way?
@nytwalker4970
@nytwalker4970 2 года назад
Hey, the compiler is throwing an error for Me keyword stating Invalid use of me keyword. How can I fix this?
@abhishekjaiswal2447
@abhishekjaiswal2447 4 года назад
Thanks. Very helpfull. But how to pull data if the 1 or 2 workbooks are open? Is it necessary to close all the workbooks before running this program. What is the solution if the file is open? I have a situation where I can't close all the files. Please help.
@ExcelDestination
@ExcelDestination 4 года назад
you can use workbooks("name of workbook").worksheets("name of sheet"). ........this is how, you can be specific to any workbook or any worksheets. Let me know if it helps.
@972seenu
@972seenu 4 года назад
Me.range getting error as invalid use of keywors..can u help to debug
@encorezhang6659
@encorezhang6659 11 месяцев назад
what is the initial value for lcurrrow?
@sameergawade15
@sameergawade15 4 года назад
Can you put it this vba code in the description link please I'm very glad if you do this Thanks..
@masterhipster8358
@masterhipster8358 4 года назад
i got an error in this line (error 448) Me.Range("A" & lcurrrow).Offset(columnoffset:=n).Value = .Range("A" & lrow).Offset(culumoffset:=n).Value
@muniswamybl7423
@muniswamybl7423 3 года назад
Please check the variable name is correct
@kathrynlindell3236
@kathrynlindell3236 3 года назад
The code works, but it only pulls in the first column of data from each sheet. How do you pull in all columns from the sheets?
@ExcelDestination
@ExcelDestination 3 года назад
pls review your code again. I was able to consolidate all data from multiple workbooks
@kumudr
@kumudr 4 года назад
Sir its really help in consolidating data to master sheet. however it will be great if you can explain code in with some description to understand for e.g. me.range couldn't figure out what does it mean.
@ExcelDestination
@ExcelDestination 4 года назад
thanks for watching. let me try.
@nileshsharma6898
@nileshsharma6898 4 года назад
Hi Sir i have followed the same coding as u did and made some of the changes like I have 15 file to merge and all those 15 files were in csv format so I have applied changes wherever required, but I am getting Run time error-9. Subscript out of range. When I have clicked on debug it highlighted the line - With wb.Sheets("Sheet"). Kindly help me in this scenario.
@ExcelDestination
@ExcelDestination 4 года назад
Error-9 occurs, when excel doesn't find the object. As you are saying that error line is "With wb.Sheets("Sheet") then you should check if sheet name is correct and wb object is declared. Without looking at complete code, I can not say much, but I would suggest to research on error 9.
@acmeacademiccouncilofmecha7569
@acmeacademiccouncilofmecha7569 2 года назад
I need that my file is shared on a network. All can update but i don't want that. I made an excel file with dashboard which is updated by different persons on network and all have their different file. Now i want that when they generate their report some particular information from their excel file should be appended in my file on network.
@sauravparui8559
@sauravparui8559 4 года назад
Can you share VBA code in text file?
@isrinivasan6218
@isrinivasan6218 3 года назад
Can I get excel file along with vba code
@yogeshkatre258
@yogeshkatre258 Год назад
I have used same macros in my file. But whilw run is used it stope at Me,Range what is the problem
@vinnydeloitte630
@vinnydeloitte630 3 года назад
This was excellent, thank you for sharing! It worked wonderfully and was easy to understand. I have a question: How do I merge into the master spreadsheet ONLY the rows of data where columns 23 or 24 are not null. I don't know how to make this modification to your vba script, please advise and thanks again!
@user-vb1fb5qs1x
@user-vb1fb5qs1x 2 года назад
ض يص شض١١سس١
@amalrajthamburaj9447
@amalrajthamburaj9447 3 года назад
Tq sir, how to combine worksheets of same structure which are in different folder with unique folder name as 2546-repo, 6756-repo,.... and so on pl give VBA code
@mohammedfaizan4566
@mohammedfaizan4566 Год назад
Can you please provide excel files in description so that it is easy to practice us.
@Jefd10
@Jefd10 4 года назад
Hi sir and thank you for the video explanation. On my case I want to be able to select the file to be copied. How can I adapt your code so a Dialogbox will open and I can select the file I need. The files to be copied are in “.csv” format. Thanks a lot.
@ExcelDestination
@ExcelDestination 4 года назад
You can use getopenfilename function........and store file name in a string and use it as per requirement........code is Dim filename As String filename = Application.GetOpenFilename()
@balagopishyam3033
@balagopishyam3033 Год назад
Bro. When you presenting this type of content. Please run the code - one by one [ f8 ]. By that we can understand how written code works
@patilpatil8262
@patilpatil8262 4 года назад
PLEASE SHARE THE EXCEL FILES AND VBA CODE FOR PRACTICE. It saves the time to do a practice.
@ExcelDestination
@ExcelDestination 4 года назад
let me check
@20AY11
@20AY11 4 года назад
Will it combine the excel cells with pi data link ?
@ExcelDestination
@ExcelDestination 4 года назад
I think so.
@kalpeshjayswal2615
@kalpeshjayswal2615 3 года назад
How to give path of files if names are different...?
@sumantube1
@sumantube1 5 лет назад
I am a biginer with VBA. Please suggest me some good book from where I can get step by step knowledge for writing VBA code.
@ExcelDestination
@ExcelDestination 4 года назад
Please use the following link. It has series of tutorials of excel vba programming from starting to advance. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-MwvQWpzuLLk.html
@alializadeh8195
@alializadeh8195 2 года назад
Thanx
@arjitkandpal9921
@arjitkandpal9921 3 года назад
Hi ! Can you please provide the code for it
@sureshrao4051
@sureshrao4051 2 года назад
Sir i have one xl file in that different sheets
@funtime-dm7wf
@funtime-dm7wf Год назад
It was great vedio I am new user for VBA would you please explain me lcurrrow an lrow
@VBASqlAccessPowerApps
@VBASqlAccessPowerApps Год назад
lrow means last row
@rajsh9122
@rajsh9122 2 года назад
Sir "ME.Range" isn't working
@raymartbalakit3062
@raymartbalakit3062 5 месяцев назад
what if I have multiple workbooks with different file names. Each workbook has a sheet with different sheet names as well. My goal is to extract results from these sheets. The range also varies and I wanted to copy and paste them on the target sheet as values.
@raymartbalakit3062
@raymartbalakit3062 5 месяцев назад
Also for each sheet I need to extract data from a defined cell ranges.
@rahulbhalshankar7901
@rahulbhalshankar7901 2 года назад
excellent
@ExcelDestination
@ExcelDestination 2 года назад
thanks
@prashantchawathey8194
@prashantchawathey8194 3 года назад
Good Morning Sir, please help, on how to transfer Data from multiple excel workbooks if all the workbooks are having different name for example instead of Day1 & Day2 it may be Prashant & Vijay than how to consolidate that all files into one Master File with easy VBA Code
@ExcelDestination
@ExcelDestination 3 года назад
for any real time project, please write to exceldestination@gmail.com. We are a freelancing team and provide you all vba support.
@urmibist6683
@urmibist6683 2 года назад
Why have you used L row and L current row.. why L any specific reason??
@sidsawant
@sidsawant 4 года назад
Sir please give VBA code in Description.............
@narasimhans1636
@narasimhans1636 Год назад
Power query will be mu h easier and simpler
@rahulraj89
@rahulraj89 Год назад
If we add new file in a folder than what will be the code
@ragavang9941
@ragavang9941 2 года назад
hi "invalid use of ME keyword"shows how to solve
@parameshtadari9245
@parameshtadari9245 4 года назад
Super video
@ExcelDestination
@ExcelDestination 4 года назад
Thanks
@rhmanagoli
@rhmanagoli 4 года назад
Dear Sir, Please Do some Videos on Multidimensional Arrays in VBA
@ExcelDestination
@ExcelDestination 4 года назад
Sure, will create some tutorials on Arrays in VBA
@tameemansaransar1944
@tameemansaransar1944 7 месяцев назад
Hi , I used same macro, But i am getting error "vba compile error object required"
@kiranmacharla1073
@kiranmacharla1073 4 года назад
Hi I deal with diff users data with no similar words... Please suggest me how I can simplify the code
@ExcelDestination
@ExcelDestination 4 года назад
Thanks for watching ! First step to consolidate data, we can check\ensure that data should be in same standard in all workbooks.
@gracesocito1402
@gracesocito1402 Год назад
What if the number of file is varying. You have 5 source files here, what if in daily basis we dont know how many it would be
@VBASqlAccessPowerApps
@VBASqlAccessPowerApps Год назад
so you can put validation in place
@VipinKumar-is2gx
@VipinKumar-is2gx 3 года назад
My file name is according to date like "day - 05.01.2021". How to enter code to search file according to this video?
@monboyblame1
@monboyblame1 3 года назад
I have a file name with different dates on daily basis then how to get these run if don't want file to be save with name ending as 1 2 3
@ExcelDestination
@ExcelDestination 3 года назад
you need to use some logic for file naming
@monboyblame1
@monboyblame1 3 года назад
@@ExcelDestination what logic can you help me with it
@rambhakat-bd6hl
@rambhakat-bd6hl Год назад
Can you please add this code in description.
@moviestalk9693
@moviestalk9693 Год назад
sir transfer to ho gaya lekin jis file se transfer karna hai uske shuru ke do row ki kuch column meger hai
@MegaMadhav27
@MegaMadhav27 4 года назад
sir in my case when i run your code it just opens all the files but do not copy its contents to the destined file. any help
@ExcelDestination
@ExcelDestination 4 года назад
I can not say anything without looking at your code. You can check your code carefully and compare it with my code..........or send me your file. I can look at your code. but only, when I will get time.
@devzaniislam5020
@devzaniislam5020 4 года назад
Your source data files need to be in Table formatting.
@sureshjogi9626
@sureshjogi9626 5 лет назад
I saw your video and good knowledge and I have followed the steps and show the error ."me" compile error invalid use of me keyword
@ExcelDestination
@ExcelDestination 5 лет назад
Thanks for watching! If you can send me the file at EXCELDESTINATION@GMAIL.COM, I can view your code and correct it .....
@sureshjogi9626
@sureshjogi9626 5 лет назад
@@ExcelDestination ok sir and I will send my files
@sureshjogi9626
@sureshjogi9626 5 лет назад
this is my mobile no.9948194232
@mdshaw3135
@mdshaw3135 5 лет назад
m also facing same issue ..can u share me correct file pls (hashme.four4@gmail.com)
@sompolkaewboonruang
@sompolkaewboonruang 4 года назад
I have also "me" error
@radheymaurya3655
@radheymaurya3655 3 года назад
If file name is not defined like day1',day2,day3and day4 then wht should I do???
@ExcelDestination
@ExcelDestination 3 года назад
you can try to build logic, as explained in the example
@clwhite1
@clwhite1 4 года назад
Why would mine open the first one and then give the error code "object does not support property or method"?
@ExcelDestination
@ExcelDestination 4 года назад
I would say check your code carefully again. You would definitely find the error.....
@jafarmiya9213
@jafarmiya9213 5 лет назад
sir if the workbook has a more then 2 sheets in that particular, how can I do this. sir, pls give me the solution
@amithpoojary4166
@amithpoojary4166 3 года назад
If it's different sheets..and if there are some unwanted file how can we pick that particular file
@PeggywongPeggy
@PeggywongPeggy 4 года назад
may I have the code.
@20thCenturyFav
@20thCenturyFav Год назад
What is the command in the code that is actually copying and pasting the data?
@kirux882
@kirux882 Год назад
the for loop section
@wongpeggy4363
@wongpeggy4363 4 года назад
but why keep asking save a copy. hmm which I feel very take time.
@sjway9686
@sjway9686 5 лет назад
Hi sir, I want to consolidate file if sheet name is different in each file, like file one has sheet name as India_Country, 2nd file has sheet name as China_Country, country is there in all file sheet name, then how to consolidate? Please help!!
@ExcelDestination
@ExcelDestination 5 лет назад
Hello. Thanks for watching...in that case you can use sheet number instead of sheet names...and run loop for total number of sheets with code like worksheets.count...try it..if you face challenge, send me your file with detail at exceldestination@gmail.com, I will try to respond.
@sjway9686
@sjway9686 5 лет назад
@@ExcelDestination hello sir, i want to make a dependent drop-down list in which if I select something in Column A then drop down will activate in column B and it should be non editable, but if Column A is blank then drop down shouldn't activate in Column B and the cell should be editable. Is it possible? Thank you, i am trying this since so long buy unable to do, please help. It's really very urgent for me.
@poojithapooja8771
@poojithapooja8771 2 года назад
Hi sir, I have consolidate sheets in different folders with different names ,how can I take all sheets data ..that script should work for all projects in every project sheet name is different
@parameshtadari9245
@parameshtadari9245 4 года назад
Sir when i try this code error is coming at set wb = workbooks. Open
@ExcelDestination
@ExcelDestination 4 года назад
Pls check the name of workbook, you want to open
@arihantp6840
@arihantp6840 7 месяцев назад
When executed, it says invalid use of Me keyword
@vickyverukhia
@vickyverukhia 3 года назад
Super
@ExcelDestination
@ExcelDestination 3 года назад
Thanks
@QWERTY-sh4zp
@QWERTY-sh4zp 2 года назад
lcurrrow is throwing error what to do
@pallavipal201
@pallavipal201 2 года назад
In this..name of files are same ..Try to give code for files of different name and from different different folders we want to import
Далее
Кошка-ГОНЧАР #шортс #shorts
00:28
Просмотров 737 тыс.
2000 vs 2100
00:15
Просмотров 20 тыс.
Спасибо Анджилишка, попил😂
00:19
How to Combine Multiple Excel Files using VBA
19:06
Просмотров 31 тыс.
VBA Macro to Copy Data from Another Workbook in Excel
13:39
Excel Macro to combine multiple Excel Workbooks
7:45
VBA Copy Specific Column From Another Workbook
12:41
Просмотров 11 тыс.
Excel VBA Combine Multiple Workbooks Into One
11:11
Просмотров 15 тыс.