Updated June 12, 2023
PART- 5 Visual Basic Editor (VBE) – Run Break Reset Design
Transcript for Video
Hello everyone in this set of video tutorial we are going to look at a the options like run Macro, break which is pause and reset and design mode earlier in the video serious we have looked at what this VBA project is all about and what are the associated properties so let go around and look at what this run Macro is all about for doing that I’ll just double click on sheet1 A and the function which we had written earlier which didn’t had anything is Sub A and bracket open and close so let’s try to write some basic code here and probably this is the first time that you may be writing up so I’ll keep it very simple so say for example in this cell A1 this is basically cell 1, 1 so I’ll write this as cells basically row index 1 column index is 1 so this is referring to this cell 1, 1 and I’ll just put some language here equal to let say this is cell 1, 1 + 1000 and this is basically your code so I have just written a simple code whatever was the earlier number just add 1000 to that earlier number so let see what happens when we run the code so basically its nothing but run button is used to run the code so if I run it once can you see on screen here on cell1,1 which A1 you will find that this is now updated for the value as 1000 so if I run it twice it will keep on updating the cell so basically this mean that you will running Macro ok this is all about Run function so what about the break function say you know you are having a serious of long codes a larger part of the macros and the here probably this is very difficult for us to kind of break or pause think of pause as some think like a DVD player were you can pause and play your DVD so likewise you can also pause your Macro and restart from where you have stopped so buttons always you know about that such. About the reset I’ll just come in movement about reset but let’s discuss about what design mode is all about ok so for looking at this, design mode I’ll actually take you to our excel sheet which we have it here and this is the design mode to turn it on we basically need to click on it ok so this is the design mode ok I’ll discuss this design mode in the contest of the control feature which we have there are actually you know 2 feature if you are aware of how excel actually works there added into 2 parts Form Control and active X controls Form control basically the buttons of the form controls were you can assign macros to and active X Control are basically those similar Controls which are in which are invisible layer or you can think of this as drawing board and you know you can change those properties by looking at different color combination change fonts etc. probably I may be sounding big confusing here let me just give you an example this is basically nothing but a form control so I have just design button which is form control button and from the insert I am also taking this active X control button so let me also take this is nothing but active X Control button Ok now what I was trying to highlight is that these command button is set on invisible layer or you can call this as drawing board and you can change this board I mean you can change the properties of the board so let me see what happens when we right click on this button the movement I right click there is format control once I click on that there is various option which are available so what can I actually format here I can change the format here I can change the format of fonts so maybe black I may want to change it red, alignment I can change it, I can change the size, I can change it protection there are certain properties margins etc. I can change that so as you can see you know I have limited option of controls here, however when I look at active X control which is in the invisible layer I’ll just do a right click and you can see this is the properties window here so what happens when we see the properties windows I guess this is the sound or this looks recognizable we had earlier looked at properties where this was the similar button which we found so we can change the back color say for example font this to be let’s blue color or maybe you know I wants to be in yellow color so you can change this button color you can change this style and the you know height, width, font etc. so you can do lot of thing here so you can see that we can change lot of properties here when we are in the design mode but let say if you get out of the design mode then you will not be able to change anything here so it access regular button where you know certain activity or function can be associated with one very important aspect of activity X control is that the macro and or code can also get attached to this specific Control button so let say if I choose this and double click on it so see what happens so movement I double click it actually text me to the VB environment and you know you will find this as it creates function which says private sub command button 1 click so this is command button 1 and it says that ok click it and it ask me to actually write code so that an advantage here so let me kind of associate some function so since we have already written sub routine here if I want to call this if I want to execute this sub routine I will just write this as call K so this would mean it will execute the sub routine called as A and probably you know I will just come out of the design mode for this I will click here and you can see that now you can run this not only from here but you may see the same result from the command button so let me try this here in the excel sheet and if I click here I am expecting that this 5000 move to 6000 because my VB environment or this command click will actually called this function A and this function A will incremented this number by 1000 so let see if this number happens or not so movement I click it increases so please note again if you are in the design mode then you even after you click it there will be no change so in order to execute behind that button you will have to come out of the design mode and then click it so this is how basically this commands actually function and active X control is pretty valuable and useful in this contest so another think I guess which we missed was regarding reset, reset is nothing but you know you may want to come out these sub routines so may be debug error or you know there was some function which you are doing you had many poses between you were something doing in this codes and you want to get out of that codes you can actually reset and come out of that whole activity which we were looking at so this is how you know the we kind of treat design mode, reset mode, the break mode and the run mode so pretty useful function which we will anyways using when we will be looking at our codes going forward.