PART- 16 – VBA (Visual Basic) Commands
Transcript for Video – VBA (Visual Basic) Commands
Video on VBA (Visual Basic) Commands – So how are you going to optimize this and you know kind of not have this additional banks as well see the idea here would be again to have code which deletes this before anything is pasted so if I select materials the first step should be to delete all this things so if I actually go back to the code I’ll show you what actually want so I want some code here which should delete this cells first and then proceed to the other thinks right so this what I want across all the clicks rights so before I paste a software list you know it should delete the original of the old less so that the first step so how do you go about you know having that code here so again as we do it for other set of thinks the first thing is to record macro and take help from excel so that it can bless us with the code and no. 2 is to logically manipulate if required as we have seen these the approaches working well with us a for the other set of things which we were doing I guess this should also work for us so what is the whole approach like record and then logically manipulates so let’s do that here so the first think I’ll do is I’ll go to Developers Tab and create temporally Macro which gives us this codes I’ll go to record and write this as temp because this is the temporally code which I am actually making and what do you I want here I want that all the things which are there is in this sheet delete it so that what I have done I have selected on the top hand left hand corner and I’ll just press my key board delete, to delete everything which is there on worksheet ok so this is the small step or small macro which I wanted to see and then next step is to look at the code and borrow that code so in order to access that code ALT F8 or Macros and this is the code which we are talking about this is the temp code and I’ll go to edit to look into this code so what does this code says, code sales. Select and selection. Clear contain very easy code sales. Select is probably associated with the selecting the full sales and selection. Clear contain clear everything so we will introduce this here as such ok so I’ll copy this code and I’ll go back to my data filter sheet were my other codes are enable so this is where I will paste it so I’ll paste this code everywhere so when we click on banks right as we did for the others we had said that ok select sheet 1 and do other task right so here we are saying that sales. Select and selection. clear contain we should also tell the code that which sheet are we talking about here we talking about sheet 1, here we were talking about data filter sheet so likewise we must tell the computer that this is the data filter sheet which we are talking about whose contain needs to be deleted before you proceed so this is the whole code which should actually serve the purpose ok so I am actually copying this code from banks to other places as well hoping that code would run material, software as well for utilities so let see if this code actually works I’ll click on the excel sheet go back and click on banks so looks fine what about materials, materials is obviously ok, software’s utilities so can you see that if I am clicking on banks there is list of 7 banks but the movement I’ll click on materials the 1st step is to delete this whole list of banks then paste materials this codes works in our beautiful fashion so that how you go about you know kind of updating customizing and upgrading are Macro so I hope to learn how to filter the data and kind of manipulate the code here.