Тёмный

How to transfer data from one workbook to another automatically using Excel VBA 

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

Our Excel training videos on RU-vid cover formulas, functions and VBA. Useful for beginners as well as advanced learners. New upload every Thursday.
For details you can visit our website:
www.exceltrainingvideos.com/c...
You can use Visual Basic for Applications in Excel to transfer data from one workbook to another Excel workbook automatically.
The process is simple once you understand the steps. It involves creating 3 variables or containers for data. Now we transfer the data from one workbook to the variables. Next we open the other workbook, locate the correct empty row and then the appropriate cells. Here we finally transfer the data from the variables into the cells and automatically save the workbook.
Get a cup of tea or coffee or a diet coke and just work through the code. It's easy!
Get the book Excel 2016 Power Programming with VBA: amzn.to/2kDP35V
If you are from India you can get this book here: amzn.to/2jzJGqU

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

 

2 апр 2013

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 297   
@reformerx667
@reformerx667 2 года назад
I have no knowledge of vba yet this made complete sense = excellent tutorial!
@Exceltrainingvideos
@Exceltrainingvideos 2 года назад
Thanks. Please share my channel with your friends.
@seanfallon4933
@seanfallon4933 11 лет назад
Your educational vidoes on Excel VBA are excellent. It has helped me sorting out some of my own code as well. Am going throught the rest of the videos as well. A really good learning curve for those who are trying to understand Excel VBA. Thank you very much.
@gunasilanm
@gunasilanm 11 лет назад
I'm a newbie in Excel VBA. The video helped me to understand well in Excel VBA. Thanks.
@seangurnett9050
@seangurnett9050 10 лет назад
excellent tutorial, thank you, from a complete beginner, you led me through the process beautifully
@Exceltrainingvideos
@Exceltrainingvideos 10 лет назад
Watch the latest video - Transfer Data from Multiple Workbooks into Master Workbook Automatically - you can also transfer data from one single cell to another worksheet or workbook.
@lenmastrapa797
@lenmastrapa797 9 лет назад
Hi Dinesh, I love all of your tutorials, very helpful.
@sasavienne
@sasavienne 5 лет назад
Useful and as usual very helpful. Thanks for letting me get this knowledge. Excel is so powerful.
@QQ-nb2ic
@QQ-nb2ic 4 года назад
I try that. Thanks
@karnvarnavat1595
@karnvarnavat1595 10 лет назад
Thank you so much. ขอบคุณมากๆ เลยมีประโยชน์ต่อ เรามาก ขอเป็นกำลังใจให้ ทำต่อไปนะครับ
@joebuty5317
@joebuty5317 10 лет назад
Very well built coding another great video! Linking!
@akshaya1983
@akshaya1983 6 лет назад
Very good instructional video Sir ! your videos are very well presented and help me a great deal in learning VBA. Thank You !
@rayadvanced2975
@rayadvanced2975 4 года назад
Thank you so much. I've watched several other videos try to explain this and this was the best one
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
You are welcome! Please share with your friends also.
@pratyushkumarmohanty3744
@pratyushkumarmohanty3744 8 лет назад
Really good one sir .... i am a very new user of VBA and i got to know exactly what i was looking for. Thank u very much.
@MOHAMMADFARIHANABDULLAH
@MOHAMMADFARIHANABDULLAH 5 лет назад
Thanks. very helpful. Got an idea to solve my VBA problem.
@Exceltrainingvideos
@Exceltrainingvideos 11 лет назад
Thank you very much!
@thefutureshiningacademy2620
@thefutureshiningacademy2620 10 лет назад
You are a very good teacher.
@Exceltrainingvideos
@Exceltrainingvideos 11 лет назад
Thank you!
@raghavshanbhag9308
@raghavshanbhag9308 11 лет назад
I appreciate you teaching style
@svmgmarblegranites481
@svmgmarblegranites481 5 лет назад
thanks for your teaching...
@beinteractivebrits4540
@beinteractivebrits4540 5 лет назад
Thank you! This helped!
@DjamelBenFirst
@DjamelBenFirst 8 лет назад
I can nt thank you enough you re a great teacher
@e-computing3920
@e-computing3920 5 лет назад
Thanks, this video really help me, thanks a lot
@bsthorve6849
@bsthorve6849 9 лет назад
This is a fantastic tutorial
@indranildreams
@indranildreams 10 лет назад
nice one..thanks for such a nice example !!!
@MarcusViniciusFerreiravferre
@MarcusViniciusFerreiravferre 3 года назад
Great video!! Thank you very much
@Exceltrainingvideos
@Exceltrainingvideos 3 года назад
Glad it helped!
@JoePena
@JoePena 9 лет назад
Thank You Sir!
@asimsarwar48
@asimsarwar48 3 года назад
Thank you so much, you are really great. 👍
@Exceltrainingvideos
@Exceltrainingvideos 3 года назад
Most welcome 😊
@alhayatprintingpress2586
@alhayatprintingpress2586 10 лет назад
very useful , thanks a lot , Edward,
@sanjibbanik9560
@sanjibbanik9560 5 лет назад
very useful code, excellent.
@Mat-ml9oq
@Mat-ml9oq 8 лет назад
Thank you so much. No where online provided the proper code. Whenever I searched it was referencing copying and pasting and nothing even showed up in the typical searches to find a way to code into another workbook. Thanks!
@marcvandenbergh5370
@marcvandenbergh5370 8 лет назад
Excelllent help.
@Exceltrainingvideos
@Exceltrainingvideos 10 лет назад
Try this: instead of the RowIndex use the Columnindex in the cell(x,y) OR just use the Range("A4:A1023") and Range ("R4:R1023") property.
@pandu7100
@pandu7100 9 лет назад
thanks a lot.
@rizalynperez1220
@rizalynperez1220 10 лет назад
hi sir i am riza from philippines, i am your no.1 follower. i currently working as accounting assistant and you are a big help to me. your tutorial is very clear.keep it up sir..thank you a lot!
@Exceltrainingvideos
@Exceltrainingvideos 10 лет назад
Welcome!
@thusithanuwan1889
@thusithanuwan1889 7 лет назад
Many thanks
@artcaley
@artcaley 9 лет назад
You suggested to get a cup of tea or coffee or a diet coke. Oh my goodness for this I had to pour some Vodka. Thank you.
@Exceltrainingvideos
@Exceltrainingvideos 10 лет назад
Try this Worksheets("Sheet1").Range("A2").Copy erow = Sheet2.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row ActiveSheet.Paste Destination:=Worksheets("Sheet2").Range(Cells(erow, 1)
@Exceltrainingvideos
@Exceltrainingvideos 10 лет назад
Instead of the RowIndex use the ColumnIndex. Hope this helps!
@akash102000
@akash102000 4 года назад
Thanks it really helped me, but the data I have to copy from input file is changed every day means I have new file every. So how to select file
@Exceltrainingvideos
@Exceltrainingvideos 10 лет назад
Just specify the cells or row where you want the data to be placed in your code.
@BARTLANTV
@BARTLANTV 3 года назад
GOOD TUTORIAL..
@Exceltrainingvideos
@Exceltrainingvideos 3 года назад
Glad you liked it. Please share with your friends too.
@ShinGoukiIX
@ShinGoukiIX 7 лет назад
This is GREAT! Thank you very much!
@sofiaauddy6533
@sofiaauddy6533 10 лет назад
Thnks a lot sir,
@Exceltrainingvideos
@Exceltrainingvideos 11 лет назад
Check out the latest video on Error Handling.
@kimmclaughlin4229
@kimmclaughlin4229 10 лет назад
Hello Sir, first thank you so much for all your tutorials...they have helped me a great deal:-) Can you please show me how to transfer data from one workbook to a master workbook and based on the criteria of column "G" copy the data to that specific worksheet? The worksheets are already named and I need this to copy into the next blank line of each worksheet.
@Cecciliciousss
@Cecciliciousss 8 лет назад
thanks!
@rufatabasov7496
@rufatabasov7496 9 лет назад
Thanks for videos could you please explain the logic of writing these vba project?
@heartiiMila
@heartiiMila 9 лет назад
Thank you for this video, it has been mighty helpful. However, I am having trouble with adding more than one entry set. What would you add to the code so that you can put multiple item names and prices at a time, instead of one by one? I am creating new variables, but only the last entry is being displayed.
@TheSkitzRacing
@TheSkitzRacing 10 лет назад
This video was very helpful for me at work, thank you! I have one question: After the VBA code saves the file that the data was transferred into I have it set to .Close the file (which also works), but after that I want the original worksheet (i.e. your video "enterData") to print and then delete the information. Can you help with this please?
@shirleycraven5406
@shirleycraven5406 9 лет назад
Hi Dinesh - this is very useful - thank you. May I ask the following questions? My questions are: 1. is it possible to have multiple workbooks writing to one master workbook 2. how do I point the VBA to the master workbook if it is held on a shared server (that all users access) 3. will I be able to use this code to export data from cells where data is selected from a dropdown menu 4. will I be able to use this code to take data from cells where the value has a lookup type formula many thanks for your help on this! kind regards Shirley
@seangurnett9050
@seangurnett9050 10 лет назад
Hi, love your tutorials. i have a userform with many comboboxes, what i would like to know is how i can transfer the data from this form to specific worksheets, determined by the selections on the combobox. i would very much appreciate your help. thank you......i am a beginner and have learn most from your videos
@hafizuddinmohdlowhim8426
@hafizuddinmohdlowhim8426 6 лет назад
You are great teacher. I wish to meet you in person
@Exceltrainingvideos
@Exceltrainingvideos 6 лет назад
My address is: S-203, Greater Kailash-2 New Delhi-110048 India If you happen to be in Delhi, give me call and if time permits we can have a coffee together.
@Exceltrainingvideos
@Exceltrainingvideos 6 лет назад
'a call'
@mikee626
@mikee626 10 лет назад
Thank you for all of your videos. They have been very helpful to me. I have a question regarding this VBA code. What happen if I have more than two columns of data to transfer? I have a total of 14 columns of data for each record that I need to transfer over to a data collection workbook or worksheet. I have used the code you've written on another video of yours but added the additional Dim's for the additional columns but I keep getting such errors as "Type Mismatch" and "Overflow". Can you please help me? Thank you again.
@fortak2006
@fortak2006 10 лет назад
Hello Sir this tutorial is very useful. But I have one question, can the marco update the "posting.xlsx" without open it? Thank you
@mangaliem6585
@mangaliem6585 4 года назад
So good
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
Thanks for the feedback!
@arzboy23
@arzboy23 11 лет назад
appreciated very much..your video is very useful for such a beginner in VBA..can i edit a microsoft database with existing programs?
@anglopak
@anglopak 9 лет назад
Thank you for the guidance - after a few tweaks got the spreadsheet to work exactly as your instructions - brilliant. Now comes my poser - I have multiple users - two input data, the rest works on the information just input and is therefore shared by approx 30 users. Each person can be at a different stages in the master file but using this code it appears to open up every time data is input stopping others from working - can it be amended in any way
@CelsoMisa
@CelsoMisa 10 лет назад
Thanks for this tutorial. This is really helpful. Is it possible to click on submit button (command button) without opening the master file? what code should I use? Thank you.
@elongshawjr38
@elongshawjr38 5 лет назад
This is fascinating: I do though have question, as I am working on a similar issue. My example/issue is I have one workbook with 6 worksheets, I am looking to copy the data within each worksheet, with a conditional value parameter , then export each worksheet to a existing /new workbook and into a pre-defined tab. Any recommendation.
@kimmclaughlin4229
@kimmclaughlin4229 10 лет назад
Hello Dinesh, I have viewed all the recommended videos and still can not find a solution to my problem. I can not get the code to transfer to a specific worksheet based on my criteria. In Column "G" there is a number (29, 50, 75, or 100). Depending on what number is in "G2" in current workbook, I need to have the entire row copied to the specific worksheet in the master workbook to the next blank row in that worksheet. The worksheets are already named, I just need to have the data transferred to the correct worksheet. I currently have a code that is working to transfer from current workbook to master workbook, but I can not get the multiple criteria to work for me.
@ronhall99
@ronhall99 10 лет назад
Can you add a line in the program to clear the contents in the first workbook, so that worksheet will always be cleared once you hit the submit button?
@Exceltrainingvideos
@Exceltrainingvideos 11 лет назад
My current knowledge: YES!
@mdamanullah6772
@mdamanullah6772 7 лет назад
nice
@raviingaleshwar5177
@raviingaleshwar5177 9 лет назад
HI Dinesh, I need a simple macro code to copy a data from one workbook to another
@asimsarwar48
@asimsarwar48 3 года назад
Excellent explained in this clip 👍 . But one question please. Once you transfer or save your data another workbook, our source workbook cells should be empty automatically apart from headers. Would you please provide some tips . Thanks in advance
@Exceltrainingvideos
@Exceltrainingvideos 3 года назад
This VBA tutorial in Excel will guide: www.exceltrainingvideos.com/transfer-specific-data-from-one-worksheet-to-another-for-reports/
@leng85
@leng85 10 лет назад
How would you edit this to add more than 1 line at a time?
@mhackerzferrer3969
@mhackerzferrer3969 11 лет назад
can i use it thru LAN sharing? this will work?
@gilokye2745
@gilokye2745 11 лет назад
Thank you very much for all the good work. I need your HELP with a task I’ve been assigned at work. Scenario: I have two workbooks saved in different folders. Folder A is where I keep the data that I constantly update (dynamic) and folder B is where I want to keep the workbook where workers can go and type in an item #, click enter and extract all the information pertaining to that #. PLEASE HELP ME WITH VBA CODE THAT CAN DO IT, Thanks
@kimmclaughlin4229
@kimmclaughlin4229 10 лет назад
I forgot to add that I need to copy the entire row with the specific criteria to each worksheet. Thanks.
@seanfallon4933
@seanfallon4933 11 лет назад
One question for my own learning, if I have to paste values, how where would I use pastespecial?? in the ".offset (rowcount, 0) = itemName " statement??
@narendrajain1977
@narendrajain1977 7 лет назад
sir I want to update data excel sheet in two different systems how to do it pls explain
@20rishi
@20rishi 10 лет назад
Hi Sir, how to use this Marcos if there is change in files name and path. As the macros can be used by different paths.
@onesri
@onesri 10 лет назад
I have 2013 version, I am not seeing the "developer" icon. where is it?
@Exceltrainingvideos
@Exceltrainingvideos 10 лет назад
Some error in the coding.
@manojshrestha6394
@manojshrestha6394 9 лет назад
Thank you for all the videos, I am having some problem here, I have excel sheet where i have different button to run a macro, We have a specific folder where we have our file saved, now this is what i am trying to do , I need to copy data the from one of those file from that folder without opening it if possible, and paste it in next sheet in same workbook, i tried what i new, and also tried to browse for the solution but still struggling with it, please need some help
@eldosekt
@eldosekt 10 лет назад
i seen many tutorials of you its great ,i have one question i have one small business i have to create some invoices,i given many formulas and data's in sheet 1 ,when i typed ,the same data automatically come to sheet 2 and sheet 3 suggest related same tutorial of you
@abhishekp1505
@abhishekp1505 5 лет назад
Hello sir, your channel is very helpful.. could you please share a video about how to import data sheet from one workbook to another.
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
This link will help: www.exceltrainingvideos.com/copy-data-paste-another-workbook-transpose-automatically-using-excel-vba/
@moyeajinomisanghan8160
@moyeajinomisanghan8160 4 года назад
@@Exceltrainingvideos what if i dont want to transpose
@anti5580
@anti5580 9 лет назад
Hi Dinesh, would you know how you can copy over more than one row? Thanks for the guide
@Exceltrainingvideos
@Exceltrainingvideos 9 лет назад
Dominic Wan Have a look at this website link:@copy-paste-multiple-rows-of-data-from-one-workbook-to-another-using-excel-vba/
@tushitajain7858
@tushitajain7858 10 лет назад
Hi I am having trouble in putting the code together to transfer data from from single cell to a different workbook? Can you please help me with the VBA code as per the example provided? Your help is much appreciated. Thanks
@marifabbas
@marifabbas 10 лет назад
Its really good just a little question, how will you make code if range is multiple cells, e.g. i have range from A4:A1023 which has product code and R4:R1023 which has price
@dhanitarawat6218
@dhanitarawat6218 8 лет назад
Hi i want to transfer data from different workbok into main workbook.Kindly help.
@lkhanaajavdorjsambuu6861
@lkhanaajavdorjsambuu6861 6 лет назад
Hello I don't know about VBA. I used your code for transfer data from workbook to another. If A column have date on 2nd workbook. What i should do in this case?
@elavarasip9154
@elavarasip9154 8 лет назад
hello sir i need one help
@mayankbansal363
@mayankbansal363 6 лет назад
Hello sir How to transfer data only through invoice no. Of pre saved invoices in your invoice billing software
@satya4uall
@satya4uall 10 лет назад
Nice tutorial..One question, how to trap the error in case the file (destination) is already open. We may wish to trap the error stating that destination file already open.Please suggest a workaround. Thanks anyways:)
@yashwantnandanwar6853
@yashwantnandanwar6853 5 лет назад
Hi sir i need your help
@mounikak3521
@mounikak3521 5 лет назад
Hi This is very helpful. I have one question. What to do if I want the saved data should be in first row instead of at the end
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
This link will help: www.exceltrainingvideos.com/add-data-from-user-form-at-top-row-below-headers-with-excel-vba/ You can also search our website www.exceltrainingvideos.com for more good stuff in Excel VBA.
@nayankumarsurepalli3692
@nayankumarsurepalli3692 8 лет назад
Hello sir, Thank you for sharing this knowledge. I have a concern, i request you to help me with it what i want is to update the data in a pre-defined table. for instance, what if i say that the i have a table including 10 item name in sheet 1 and 2, I just want to update the prices in the opposite column. I.e. when i enter a price for sony, it should get updated in front of sony in the second table. i hope you understood my query. i want to add an update button that will do a vlookup and then update in a defined criteria.
@giteshkasare3232
@giteshkasare3232 8 лет назад
Hi my name is Gitesh, I am working on project where i need to open 5 different web links in google Chrome at a time which will reduce my work time and help me to speed up with the help of Vba code. I have created button and able to open only one link. I need help on this. I have used shell code however i don't have access for C drive in my office. It needs admin right which i don't have. Is there any other way to make it. I need to complete this work as early as possible. Thanks
@beensheen2
@beensheen2 11 лет назад
can u pls post the download link
@ethans3977
@ethans3977 10 лет назад
Thank you sir! This is very helpful especially for those who are new to excel VBA. I have a question. I have 46 workbooks. I wanna do the same thing to change the data for the 46 of them at once. So i create the 47th workbook to do that. But the problem is, these 46 workbooks will be sent to different individuals. And everytime i want to transfer the data, i only need it to appear at the same cell (the previous data will be replaced by the current data i am entering). Is it possible? TQVM! =)
@ketanpatel5502
@ketanpatel5502 10 лет назад
I am trying to create Macro for 464 column with formula but getting error message“ too long Array” .please advice
@karanjaiswal6172
@karanjaiswal6172 7 лет назад
If instead of price I have date what will be the command instead of 'single' in vba ?
@hemangmehta8281
@hemangmehta8281 8 лет назад
Hello. this video is really helpful but i am facing some issues as my data headers in enterData worksheet are laid horizontally like ItemName | Item Price etc and i want to copy this data to Postings in which data headers (field names) are laid vertically like Item Name Item Price. What changes should i make in the code. Thanks a lot in advance as this is urgent requirement
@mariakatsarova3732
@mariakatsarova3732 7 лет назад
I have a question.When trying to run the macro I receive an error message that Excel cannot reach the second file/where the data should be transferred/.What could be the reason?
@loiphamthe873
@loiphamthe873 10 лет назад
Dear Sir, What if the posting file is on a shared drive? Thank you very much,
@thanhbui40
@thanhbui40 10 лет назад
Cảm ơn đã share nha anh
@timmy007888
@timmy007888 10 лет назад
Hi I am new in this Excel VBA and I have the following issueand would like you to help me:- 1. The line of "Rowcount" was popped up and asked me to declair variable. But it stopped after I place the line "Dim RowCount as Interger" at the top. However, it funny enough the error stopped again after I changed it to a note. Why is this happen when no command call "Rowcount"? 2. The error code Run-time Error "438" and the error pointed at the command line "With Worksheet....." Thank you.
@lenmastrapa797
@lenmastrapa797 9 лет назад
Hi Dinesh, I created a purchase order and I retrieve my data sets from a listbox, which I created in Userform. When I export the data from the listbox it looks for the next available cell; however I would like the data to be transferred into selected cells like A20, B20,C20 D20, E20, F20, G20. How can I transfer the data set into selected cells? Please advise... Len
@marifabbas
@marifabbas 10 лет назад
I am getting Run time error 13 (type mismatch) Product = Range("A4:A1023")
@excel_learn8674
@excel_learn8674 11 лет назад
Can you enter data in a workbook that in located a Share Point Intranet, and have it update in automatically into a workbook that would be located in a share drive? thanks!
@rmdempsey87
@rmdempsey87 6 лет назад
Thank you for this video. It is very helpful. I am looking to modify the VBA code to have members of my team change the Workbooks' names that that Master Workbook will reference. For example, I wanted the Master Workbook to have a Worksheet called "Names" and another called "Data". The "Names" worksheet would reference the file location and the different Workbooks that I want the VBA code to reference instead of hard-coding in VBA. Is it possible to have a VBA that references an entered cell value as a part of it's formula?
@Exceltrainingvideos
@Exceltrainingvideos 6 лет назад
Have tried a 'Link'?
@21manishgupta
@21manishgupta 9 лет назад
Hello Mr. Takyar, I am totally a novice to VBA and do not understand the codes. Though I have had opportunity to record macros in excel by doing the action but never had the heart to look at the gigantic codes. But finally I have reached a point where in I have to perform more complex actions using excel that cannot be just recorded. Thus, Can you please help teach me/ guide me / mentor me in achieving my goals in learning VBA for excel? Currently I am working on reporting. Where in We have some hard deadlines to receive data in certain fields. In case if the user has not provided the same by a given date, (earlier than the dead line) then I wished to send them a reminder email to update the fields. Now the Caveat is the list might have almost 100 - 500 people and many of the names will be repeated... so there has to be just 1 email that needs to be send to the person with the details of the items / fields missed by him/her. Please advice if you will be able to guide me through this.. thanks in advance... Best regards, Manish Gupta
Далее
😍😂❤️ #shorts
00:12
Просмотров 1,1 млн
НЕ ДЕЛАЙТЕ УКЛАДКИ В САЛОНАХ
00:43
VBA Macro to Copy Data to Another Workbook
10:30
Просмотров 68 тыс.
VBA Macro to Copy Data from Another Workbook in Excel
13:39
😍😂❤️ #shorts
00:12
Просмотров 1,1 млн