Can the Macro Recorder dynamically find the end of a range?
This is where relative and absolute macro recording come into play.
Each one has their advantages and disadvantages.
In this tutorial I show you how you can use the macro recorder to copy data from one Worksheet to another sheet. In fact we copy the data to the bottom of an existing data set from two different tabs. We also insert a button and assign the macro to it.
Note: This video is part of my upcoming Excel VBA & Excel Macros course called Unlock Excel VBA & Macros which is due to be out in April. To receive your launch discount make sure you register your name here.
In the course we go from basic all the way to advanced. Check out the last 2 minutes of this video to get an overview of the course topics.
Feel free to Download the Workbook HERE.
Hi, I love your style of teaching and your grasp of knowledge of Excel. I have seen many of your tutorials on Youtube and like them all esp VBA tutorials. You have made complex and rather confusing VBA topic into so simple and easy to understand. Thanks and keep it up..
Thank you for your kind comment. I’m very happy to hear you find the lectures easy to follow :)
Leila I must say that you are fabulous. How easiest way you adopt to explain the things in detail. Its really easy to comprehend. I must say that your each and every effort to spread the knowledge is highly commendable.
Thank you Asim! I’m glad you find the tutorials easy to follow and apply. Thank you for your support.
Hi Leila,
Your video tutorials on VBA are really helpful for me to meet daily requirements of my office. I have a small question if you may answer;
I learned how to copy data from one sheet to another using VBA.
How can I check for duplication of data before pasting in new sheet and also sort the data date wise automatically ? I need to create a database of 1 month on daily basis. I don’t wan’t disarranged data.
Thanks,
Faisal
Hi Faisal – I’m glad to hear you can apply the tutorials to your work. What I would personally do in this case is to first paste the data and then remove duplicates. It’s much easier and faster for Excel to work with data directly in Excel. You could import them to a separate tab, clean the data (you can use the remove duplicates button from the Data tab and then sort as you like – a macro captures the code you need) – you can tweak the macro to dynamically find the last row and then cut and paste to your final destination. I’m not sure if you’re in my VBA course but we do something similar in the 2nd milestone of the course where we import data from different files, clean them up and then copy for our report.
Hi Leila,
Try your macro when the Summary Sheet has no records. It does not work.
Hi Valery. Yes – debugging needs to be done to make it full-proof. This lecture is a part of my VBA course. Once we learn more of language and debugging methods, we learn how to make such macros full-proof.
Hi this is very useful but when am trying to copy the cells which has formula i want to copy that data and paste it in summary sheet is it possible.
I am assuming you are wishing to paste the results of the formulas onto the summary sheet. After you perform the COPY operation, switch to the summary sheet and perform a PASTE VALUES operation.
If this is not what you are referencing, please let us know with a detail example.
Thanks – XelPlus Team
please i enjoyed your videos. my name is Henry an active military guy. i have many forms that i am printing with peoples information i am able to sent the forms to print with those information but the problem is that i have to filter the name one after the other to print each form. i search for names from a list of names i have in excel run it one at a time. i am trying to see if you can help me with a macro that can go through the list one at a time and past the name for me in my pivot table run it and sent it to print.
right now i can only past manually and use the macro and print it but i can not get the macro to get the data from another list and past on my pivot filter to run and print
Due to other commitments we currently don’t offer any consulting work. You could try Upwork. They have many Excel specialists that may be able to help you with your macro.