VBA PLAYLIST: • Learn Excel VBA (Visual Basic for Applicat...
This second clip in this VBA video series shows how to create a function in Visual Basic for Applications (VBA) in Microsoft Excel. Follow along through several practical examples.
hello guys my name is Scott and actually in today's video I will show you guys that how can make functions in Visual Basic so before going towards visual basics I will give you an example and then I will show you guys that what does it mean when making a function in Excel so suppose you have a column X and X have some numbers in it so suppose Texas two for by so I'm giving some random number and in the next column suppose you want to have a squared of these values so if it's here - it's here in 1 - square hairs means 4 here so one way is doing it that you slept the value of 2 in a two cell and then C square by this so as you can see that now we have square here and applied on the pole the five cell you can see that Excel is doing square of this column a but in this way I'm writing the whole function but in some cases but on but if you want to make a function of your own to it make a square of number you can also do that in order to do that you have to go to the developer in order to create a macro so in my previous video I've show i've already only where that if you don't have this Developer tab then you have to go to file and you have to go options under the option that is customizable and under the customize ribbon probably your developer option will not be checked in just check in and then say ok and your Developer tab will appear and after that in order to create a function in Visual Basic you have to slap this visual basic option click it so this is the way then you can offer Visual Basic by clicking the option so if I close this window so there is also a short key to open a window for visual basic which is if you press or and then act level so you can see that I have the visual basic application is running now this dimer pops open up for me for visual basic so now what I do I have to make a function I have to write down some coding so in order to do that if you see just maximize the window this is a down arrow here and if you click this down arrow they're different options you have to click this mod you actually module is a kind is a court file so it will open a window where you will be able to write down your code and that code will be applicable on your whole taxol book so my accent book means that they define both of this page all the sheets and all this this is actually considered as 1x ago so whatever function you will create will be applicable on this axial wind or axial book so I will go back to my court might be good basic window so now I would create a function so in order to create a function there is a command you have to start with a function so Excel will know that you are going to create a function and then you will give a function name so suppose if I want to give it my function so I say get my function and then use brackets and under the bracket I will tell Excel that what are the arguments I will be getting in this function so bad argument means that how many number of values you will be using to produce an output of that function so in this case I am just using one x values my argument will be just one value and I am actually will be using one value and the function in the putting also one value so under this bracket I'll be telling that how many how many variables I am using to create an output value for this case I'll be using just one so I'd be saying X you can use anything you can say X Y Z or whatever you want I will be saying X here X as the double so what happened double so actually each variable have different types integers if the numbers are in 1 2 3 if the taxes is you will always take 1 2 3 or 4 values if X is taking 1.1 1.2 then you can use flawed but double even if it's taking a integer values 2 so it's better to take it is better to define that X is as double or as a floating value because then you will not get an error but it's fuzzy I define X as an integer then if you enter a value suppose if I enter a value 2.1 here your function may give you an error so it's better to consider
Auf dieser Seite können Sie das Online-Video 2. Create your own Function in Excel VBA (Visual Basic for Applications) mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Learn data analytics with us 01 Januar 1970 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 102 Mal angesehen und es wurde von 1 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!