

{"id":102261,"date":"2021-10-12T09:00:52","date_gmt":"2021-10-12T03:30:52","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=102261"},"modified":"2021-10-12T12:30:30","modified_gmt":"2021-10-12T07:00:30","slug":"excel-vba-functions-with-examples","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/excel-vba-functions-with-examples\/","title":{"rendered":"Excel VBA Functions with Examples"},"content":{"rendered":"<p>In this tutorial, we will learn about VBA Functions like Return, call and Examples.<\/p>\n<h3>What is a Function?<\/h3>\n<p>The term function refers to a code snippet which performs the specified task provided in the code and it provides or returns a result. Functions help to carry out repetitive tasks such as reading the data from the database, performing required calculations etc.<\/p>\n<p>If the user is developing a program that calculates the average sale of a company. The user can create a function that accepts the monthly sales. The function can then use the sales details to calculate the average and return the value.<\/p>\n<h3>Why use functions in Excel VBA?<\/h3>\n<p>The advantages of using functions are:<\/p>\n<h4>1. Break code into small modules<\/h4>\n<p>Source code lines of a program vary as per the requirement and objective of the program. A program can contain multiple thousand source code lines. As the code lines increase, the complexity of the program also increases. In order to reduce the complexity of the program, the user can make use of subroutines and break down the program into smaller modules.<\/p>\n<h4>2. Reusability of the code<\/h4>\n<p>If the user has a program which needs to access the multiple databases, then the user can create a function that handles the database interaction. Instead of writing the code every time, the user can call it whenever it&#8217;s required.<\/p>\n<h4>3. Functions are self-documenting<\/h4>\n<p>The functions and subroutines are called self documenting because a programmer can say what the program does by just looking at the name of the function or subroutine.<\/p>\n<h3>Function Vs Subroutine in VBA Excel<\/h3>\n<p>A subroutine allows the user to execute a set of code while a function returns a value.<\/p>\n<h4>Rules of naming functions<\/h4>\n<p>Before naming the subroutines and functions, follow the rules:<\/p>\n<ul>\n<li>The first character is a letter or an underscore.<\/li>\n<li>Do not use special characters or numerics such as 1, !, @, &amp;, ., #<\/li>\n<li>The name should not be a reserved keyword as the compiler uses it for specific tasks.<\/li>\n<li>The function name should not contain space.<\/li>\n<\/ul>\n<h3>VBA Syntax for declaring a Function<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Function Function_name(list of parameters)\r\n\r\nStatement1\r\n.\r\n.\r\n.\r\nStatement_n\r\n\r\nEnd Function<\/pre>\n<h3>VBA Syntax for declaring a sample Function<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Private Function FunctionName (ByVal argument_1 As Integer, ByVal argument_2 As Integer)\r\n\r\ntotal=argument_1+argument_2\r\n\r\nEnd Function<\/pre>\n<h4>Code Explanation:<\/h4>\n<ul>\n<li>\n<h5>Private Function functionName() &#8211;<\/h5>\n<\/li>\n<\/ul>\n<p>Here the sub declares a function named \u201cfunctionName\u201d and starts the body of the function. To specify the scope of the function, the keyword \u201cprivate\u201d is used.<\/p>\n<ul>\n<li>\n<h5>ByVal argument_1 As Integer, ByVal argument_2 As Integer &#8211;<\/h5>\n<\/li>\n<\/ul>\n<p>This declares two parameters of integer data type named argument_1 and argument_2<\/p>\n<p>functionName=argument_1+argument_2<\/p>\n<p>This evaluates the two numbers and assigns the value to the functionName.<\/p>\n<h4>End Sub &#8211;<\/h4>\n<p>This denotes the end of the function body.<\/p>\n<h3>Function demonstrated with Example:<\/h3>\n<p>Functions are also the same like subroutines. The one main difference between the function and subroutine is that the function returns a value whenever it is called whereas the subroutine does not return a value when it is called.<\/p>\n<p>Now let&#8217;s see how to create a function which accepts two numbers and returns the product of the numbers.<\/p>\n<p>The below steps are the processes on how to call functions in vba.<\/p>\n<p>1: Design the user interface and set the properties as per the requirement for the user controls.<\/p>\n<p>2: Add the function in the program.<\/p>\n<p>3: Mention the client event code for the button which calls the subroutine.<\/p>\n<p>4: Application testing.<\/p>\n<h3>Step by step process<\/h3>\n<p>Step &#8211; 1: Designing the user interface and setting the properties<\/p>\n<p>Design the user interface by setting the name properties to btnDisplayProduct and the caption to DataFlair_Function.<\/p>\n<p>Your GUI appears as follows:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/gui-dataflair-functions.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-103223\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/gui-dataflair-functions.png\" alt=\"gui dataflair functions\" width=\"1153\" height=\"845\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/gui-dataflair-functions.png 1153w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/gui-dataflair-functions-768x563.png 768w\" sizes=\"auto, (max-width: 1153px) 100vw, 1153px\" \/><\/a><\/p>\n<p>Step 2: Adding the function.<\/p>\n<p>Open the code window by clicking on the view code option under the developer tab. Add the following function code in the VBE editor<\/p>\n<h4>Code:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Private Function DataFlair_Function(ByVal firstnum As Integer, ByVal secondnum As Integer)\r\n\r\nDataFlair_Function = firstnum * secondnum\r\n\r\nEnd Function<\/pre>\n<h4>Code Explanation:<\/h4>\n<ul>\n<li>\n<h5>Private Function DataFlair_Function &#8211;<\/h5>\n<p>This declares a private function \u201cDataFlair_Function\u201d that accepts two integer parameters.<\/li>\n<li>\n<h5>ByVal firstnum As Integer, ByVal secondnum As Integer &#8211;<\/h5>\n<p>This declares two parameter variables and those are \u2018firstnum\u2019 and \u2018secondnum\u2019.<\/li>\n<li>\n<h5>productNum = firstnum * secondnum &#8211;<\/h5>\n<p>This accepts the two integer values, multiplies it and assigns the product value to the productNum.<\/li>\n<\/ul>\n<p>Step 3: Calling the function from the command button click event.<\/p>\n<ul>\n<li>Open the code window by clicking on the view code option under the developer tab.<\/li>\n<li>This opens the code editor window.<\/li>\n<\/ul>\n<p>Add the following code in the code editor for the click event of the btnDisplayProduct command button.<\/p>\n<h4>Code:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Private Sub btnDisplayProduct ( )\r\n\r\nMsgBox DataFlair_Function (2,100)\r\n\r\nEnd Sub<\/pre>\n<h4>Code Explanation<\/h4>\n<ul>\n<li>\n<h5>MsgBox DataFlair_Function(2,100) &#8211;<\/h5>\n<\/li>\n<\/ul>\n<p>This calls the function <strong>DataFlair_Function<\/strong> and passes in 2 and 100 as the parameters. The function returns the product of the two numbers i.e., 200.<\/p>\n<p>The first part of the code lines are the function code and the second part of the code lines are the click event code which calls the function from the command button.<\/p>\n<p>Press the save button to save the changes and close the editor window.<\/p>\n<p>Step 4: Testing the Application<\/p>\n<p>To test the application, follow the steps:<\/p>\n<p>Step 1: Go to the Developer tab.<\/p>\n<p>Note: Check whether the design mode is on or off. If it is on, then the application wouldn\u2019t work.<\/p>\n<p>Step 2: Click on the Design Mode to turn it off.<\/p>\n<p>Step 3: Click on the newly created button.<\/p>\n<p>The following output appears.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/output-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-103226\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/output-1.png\" alt=\"output\" width=\"1316\" height=\"745\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/output-1.png 1316w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/output-1-768x435.png 768w\" sizes=\"auto, (max-width: 1316px) 100vw, 1316px\" \/><\/a><\/p>\n<h3>User Defined Functions in Excel<\/h3>\n<p>Excel has many collections of functions. In many situations those functions are more than enough to complete the task. If not, then the user can create a own function and that is called a user defined or custom excel function. The user can access a user defined function just like any other excel function.<\/p>\n<p>Now, let\u2019s create a function called SUM_ODD that finds the sum of the odd numbers of a randomly selected range.<\/p>\n<h4>Code:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Function SUM_ODD(rng As Range)\r\n\r\nDim cell As Range\r\n\r\nFor Each cell In rng\r\n\r\nIf cell.Value Mod 2 = 0 Then\r\n\r\nSUM_ODD= SUM_ODD + cell.Value\r\n\r\nNext cell\r\n\r\nEnd If\r\n\r\nEnd Function<\/pre>\n<h4>Code Explanation:<\/h4>\n<p>Here, the code works on any cell on the worksheet and it sums up all the odd values in the cell range as we have not mentioned any specific cell range.<\/p>\n<p>Note: Any function written and accessed by the user, apart from the built in functions are known as user defined functions.<\/p>\n<h3>Understanding the Scope of a User Defined Function in Excel<\/h3>\n<p>There are two scopes in a function and they are:<\/p>\n<ul>\n<li>Public Scope<\/li>\n<li>Private Scope<\/li>\n<\/ul>\n<h4>1. Public scope<\/h4>\n<p>In public scope, the function is available for all the sheets in the workbook as well as all the procedures across all modules in the sheet. This is useful when the user wants to call a function from a subroutine.<\/p>\n<h4>2. Private Scope<\/h4>\n<p>In private scope, the function is available only in the module in which it is provided. The user can\u2019t use it in other modules. The user won\u2019t see it in the list of functions in the spreadsheet. For example, if the function name is \u2018 DataFlair()\u2019, and the user type function in excel after the \u201c=\u201d sign, it will not show the function name. But still the user can use it if they enter the formula name.<\/p>\n<h3>Calling an User Defined Function from Other Workbooks<\/h3>\n<p>If the user has a function in a workbook, then the user can call the function in other workbooks also. There are different ways to do it and they are:<\/p>\n<ul>\n<li>Create an Add-In<\/li>\n<li>Save the function in Personal Macro Workbook<\/li>\n<li>Refer the function from another worksheet<\/li>\n<\/ul>\n<h4>1. Create an Add-in<\/h4>\n<p>After creating and installing an add-in, the user will have the custom function in it available in all the workbooks.<\/p>\n<p>Imagine the user has created a custom function \u2013 \u2018GetNumeric\u2019 and the user wants it in all the workbooks. In order to do that the user has open a new workbook and have the function code in a module in the new workbook. Now, follow the steps to install the function in Excel.<\/p>\n<p>1: Go to the File tab and click on the \u201cSave As\u201d option.<\/p>\n<p>2: Change the file extension to .xlam.<\/p>\n<p>Note: The name the user assigns to the file will be the name of the add-in. The user can also notice that the path of the file where it gets saved automatically changes.<\/p>\n<p>3: Open a new Excel workbook<\/p>\n<p>4: Click on the Excel Add-ins option under the Developer tab.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/add-ins.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-103227\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/add-ins.png\" alt=\"add ins\" width=\"958\" height=\"495\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/add-ins.png 958w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/add-ins-768x397.png 768w\" sizes=\"auto, (max-width: 958px) 100vw, 958px\" \/><\/a><\/p>\n<p>5: In the Add-ins dialogue box, browse and locate the file that you saved with the function.<\/p>\n<p>6: After check marking on the function, click the ok button.<\/p>\n<p>Note: Finally, the add-in has been activated and the user can use the custom function in all the workbooks.<\/p>\n<h4>2. Referencing the function from another workbook<\/h4>\n<p>If the user wants to refer to the function from another workbook, then that workbook has to be opened.<\/p>\n<h4>3. Syntax to refer a function from another workbook:<\/h4>\n<p><strong>= \u2018Workbook_Name\u2019!Function_Name(Cell_number)<\/strong><\/p>\n<p>Here, in the workbook_name place the user has to place the workbook name of the function. Function_name refers to the name of the function and the cell number denotes the cell number.<\/p>\n<h3>Excel Inbuilt Functions vs VBA User Defined Function<\/h3>\n<p>There are few advantages of using Excel in-built functions over custom functions created in VBA and they are:<\/p>\n<ul>\n<li>VBA functions are quite slower than the inbuilt functions.<\/li>\n<li>When the user creates a report using VBA functions, and if they send it to another user, then they need not have to worry about whether the macros are enabled or not.<\/li>\n<li>Note: In some cases, the other users get scared by looking at the warning symbol in the yellow bar and that warning is simply a request to the user to enable the macros.<\/li>\n<li>With inbuilt Excel functions, the user doesn&#8217;t need to worry about the file extensions. If the user has macros or user-defined functions in the workbook, then they need to save it in .xlsm.<\/li>\n<li>It\u2019s better to use a user-defined function if the inbuilt formula is huge and complicated.<\/li>\n<li>When the user has to get something specifically done then that can not be done by Excel inbuilt functions.<\/li>\n<\/ul>\n<h3>Volatile Functions in VBA<\/h3>\n<p>The user defined functions in excel are not volatile by default. When any of the arguments in the function changes, they perform the task and recalculate again. A volatile function recalculates, whenever calculation occurs in any part of the worksheet. Let\u2019s look at a sample.<\/p>\n<h4>Code:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Function DATAFLAIR(cell As Range)\r\nDATAFLAIR = cell.Value + cell.Offset(1, 0).Value\r\nApplication.Volatile\r\nEnd Function<\/pre>\n<h4>Code Explanation:<\/h4>\n<p>Here, we have created a function called DATAFLAIR and this function returns the sum of the selected cell and the cell below that particular selected cell.<\/p>\n<p>Note: The code is non volatile when you don&#8217;t enter the \u201cApplication. Volatile\u201d statement in the code. The non-volatile function is not recalculated when any other cell on the sheet changes and it recalculates only when the arguments in the function changes.<\/p>\n<h4>Output:<\/h4>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/volatile.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-103228\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/volatile.png\" alt=\"excel volatile function\" width=\"1893\" height=\"955\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/volatile.png 1893w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/volatile-768x387.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/volatile-1536x775.png 1536w\" sizes=\"auto, (max-width: 1893px) 100vw, 1893px\" \/><\/a><\/p>\n<p>The \u201cDATAFLAIR(A2)\u201d is called in the D8 cell and this is how we call the function generally in the sheet.<\/p>\n<p>Note: If the user first creates the non-volatile function then the user needs to enter the function again to make it volatile after adding the required statements in the code.<\/p>\n<h3>By Ref and ByVal<\/h3>\n<p>The user can pass the arguments to a function procedure by reference or by value. The VBA passes arguments by reference as default. Let\u2019s look at a sample.<\/p>\n<h4>Code:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Dim num As Integer\r\nnum = 2\r\nMsgBox Double(num)\r\nMsgBox num<\/pre>\n<h4>Code Explanation:<\/h4>\n<p>Here, the code calls the function num. It&#8217;s the result of the second MsgBox that we are looking for and this function needs to be placed into a module. Now, open the module and add the below function code.<\/p>\n<h3>Function Code:<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Function Double(ByRef num As Integer) As Integer\r\nnum = num * num\r\nDouble = num\r\nEnd Function<\/pre>\n<h4>Output:<\/h4>\n<p>The following output appears when the user clicks on the command button.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/calc-op.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-103229\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/calc-op.png\" alt=\"calc output\" width=\"947\" height=\"496\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/calc-op.png 947w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/calc-op-768x402.png 768w\" sizes=\"auto, (max-width: 947px) 100vw, 947px\" \/><\/a><\/p>\n<h4>ByVal:<\/h4>\n<p>Now, let&#8217;s see an example of replacing ByRef with ByVal.<\/p>\n<h4>Code:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Function calc(ByVal num As Integer) As Integer\r\nnum = num * num\r\ncalc = num\r\nEnd Function<\/pre>\n<h4>Code Explanation:<\/h4>\n<p>The user refers to the original value when the passing arguments are by reference. The value of num is generally changed in the function and as a result the second n=message box displays the changed value. If the user passes the arguments by value then they are passing a copy to the function and hence the original value does not change. As a result, the second message box displays the original value.<\/p>\n<h4>Output:<\/h4>\n<p>The following output appears when the user clicks on the command button.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/byref-output.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-103231\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/byref-output.png\" alt=\"byref output\" width=\"940\" height=\"487\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/byref-output.png 940w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/byref-output-768x398.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/byval-output.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-103230\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/byval-output.png\" alt=\"byval output\" width=\"944\" height=\"497\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/byval-output.png 944w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/byval-output-768x404.png 768w\" sizes=\"auto, (max-width: 944px) 100vw, 944px\" \/><\/a><\/p>\n<h3>Built-in VBA Functions<\/h3>\n<p>VBA provides a large number of built-in functions that can be used in your code. The most popular built-in VBA functions are listed below. Select a function name to go to a full description of the function with examples of use.<\/p>\n<h4>1. VBA Message Functions<\/h4>\n<table>\n<tbody>\n<tr>\n<td><b>Function<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">InputBox<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It displays a dialog box where the user can enter the input<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">MsgBox<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It displays a message box<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>2. VBA Text Functions<\/h4>\n<table>\n<tbody>\n<tr>\n<td><b>Function<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Format<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the result as a string and it applies a format to an expression.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">InStr<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the substring position in a string.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">InStrRev<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the substring position in a string searching from right to left.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Left<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the substring from the beginning of a provided string.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Len<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the length of the provided string.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">LCase<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts the string elements to lower text cases.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">LTrim<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It removes the extra spaces in the string.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Mid<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the substring from the middle of a string.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Replace<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It replaces a substring with the new string.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Right<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns a substring from the end of the string.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">RTrim<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It removes the extra spaces from the right side of the string.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Space<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It creates a string consisting of a specified number space.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">StrComp<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It compares the two strings and returns the result in an integer representing the comparison.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">StrConv<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts a string to a particular format mentioned.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">String<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It creates a sequence of characters in a string.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">StrReverse<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It reverses the string.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Trim<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It removes the spaces in the beginning and in the ending of the string.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">UCase<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts the string to upper case characters.\u00a0<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>3. VBA Information Functions<\/h4>\n<table>\n<tbody>\n<tr>\n<td><b>Function<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">IsArray<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It tests whether the provided variable is an array or not.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">IsDate<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It tests whether the provided expression is a date or not.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">IsEmpty<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It tests whether the provided variant is empty or not.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">IsError<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It tests whether the provided expression is an error or not.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">IsMissing<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It tests whether an optional argument procedure is missing or not.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">IsNull<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It tests whether the expression is null or not.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">IsNumeric<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It tests whether the expression is numeric or not.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">IsObject<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It tests whether the variable represents an object variable.\u00a0<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>4. VBA Error Handling Functions<\/h4>\n<table>\n<tbody>\n<tr>\n<td><b>Function<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">CVErr<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It produces an error data type for a provided error code.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Error<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the error message corresponding to the provided error code.\u00a0<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>5. VBA Program Flow Functions<\/h4>\n<table>\n<tbody>\n<tr>\n<td><b>Function<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Choose<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It selects a value from the argument list.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">llf<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns one of the two values by evaluating an expression. It evaluates to true or false.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Switch<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the value associated with the first true expression by evaluating a list of boolean expressions.\u00a0<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>6. VBA Conversion Functions<\/h4>\n<table>\n<tbody>\n<tr>\n<td><b>Function<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Asc<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns an integer representing the code for a provided character.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">CBool<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts an expression to a boolean data type.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">CByte<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts an expression to a byte data type.\u00a0\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">CCur<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts an expression to a currency data type.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">CDate<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts an expression to a date data type.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">CDbl<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts an expression to a double data type.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">CDec<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts an expression to a decimal data type.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Chr<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the character corresponding to the provided character code.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Clnt<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts an expression to an integer data type.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">CLng<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts an expression to a long data type.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">CSng<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts an expression to a single data type.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">CStr<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts an expression to a string data type.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">CVar<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts an expression to a variant data type.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">FormatCurrency<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts the expression to currency format and returns the result as a string.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">FormatDateTime<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts the expression to date and time format and returns the result as a string.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">FormatNumber<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts the expression to number format and returns the result as a string.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">FormatPercent<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts the expression to percentage format and returns the result as a string.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Hex<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts the numeric value to hexadecimal value and returns the result as a string.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Oct<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts the numeric value to octal value and returns the result as a string.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Str<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts a numeric value to a string.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Val<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It converts a string to a numeric value.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>7. VBA Date and Time Functions<\/h4>\n<table>\n<tbody>\n<tr>\n<td><b>Function<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Date<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the current date.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">DateAdd<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It adds an interval between the date or time.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">DateDiff<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the number of intervals between the two dates or time.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">DatePart<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns a part of a date or time<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">DateSerial<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the date from the provided date details.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">DateValue<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns a date from the string representation of a date or time.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Day<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It represents the day number which is either from 1 to 31.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Hour<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the hour component in the time mentioned.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Minute<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the minute component in the time mentioned.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Month<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the month number which is either from 1 to 12.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">MonthName<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the month name.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Now<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the current date and time.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Second<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the second component in the time mentioned.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Time<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the current time.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Timer<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the number of seconds that have elapsed.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">TimeSerial<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the time from a provided hour, minute and second.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">TimeValue<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the time from a string representation.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Weekday<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns an integer from 1 to 7 representing the weekday.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">WeekdayName<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the name of the weekday.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Year<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the year of the provided date.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>8. VBA Math and Trig Functions<\/h4>\n<table>\n<tbody>\n<tr>\n<td><b>Function<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Abs<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the absolute value.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Atn<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the arctangent value of a provided number.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Cos<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It evaluates the cosine value of the provided angle.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Exp<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It calculates the value of e to the power of x for the provided value of x.<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">It rounds the negative numbers towards zero.<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">This returns the integer.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Log<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It calculates the natural logarithm value.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Rnd<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It generates a random number between 0 and 1.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Round<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It rounds a number to a mentioned number of decimal places.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Sgn<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns an integer representing the arithmetic signs.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Sin<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It evaluates the sine value.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Tan<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It evaluates the tangent value.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Sqr<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the square root value.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>9. VBA Financial Functions<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Function<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td>DDB<\/td>\n<td>It calculates the depreciation of an asset using the double declining method during a mentioned period.<\/td>\n<\/tr>\n<tr>\n<td>FV<\/td>\n<td>It calculates the future value of an investment.<\/td>\n<\/tr>\n<tr>\n<td>IPmt<\/td>\n<td>It calculates the interest for a payment for a loan.<\/td>\n<\/tr>\n<tr>\n<td>IRR<\/td>\n<td>It calculates the internal rate of return for periodic cash flows.<\/td>\n<\/tr>\n<tr>\n<td>MIRR<\/td>\n<td>It calculates the modified internal rate of return for periodic cash flows.<\/td>\n<\/tr>\n<tr>\n<td>NPer<\/td>\n<td>It calculates the number of periods for an investment.<\/td>\n<\/tr>\n<tr>\n<td>NPV<\/td>\n<td>It calculates the net present value of an investment.<\/td>\n<\/tr>\n<tr>\n<td>Pmt<\/td>\n<td>It calculates the constant periodic payment for an investment.<\/td>\n<\/tr>\n<tr>\n<td>PPmt<\/td>\n<td>It calculates the principal of a payment during a mentioned period for an investment.<\/td>\n<\/tr>\n<tr>\n<td>PV<\/td>\n<td>It calculates the present value.<\/td>\n<\/tr>\n<tr>\n<td>Rate<\/td>\n<td>It calculates the interest rate for an amount.<\/td>\n<\/tr>\n<tr>\n<td>SLN<\/td>\n<td>It calculates the straight line depreciation of an asset.<\/td>\n<\/tr>\n<tr>\n<td>SYD<\/td>\n<td>It calculates the sum of years depreciation for a mentioned period in the lifetime of an asset.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>10. VBA Financial Functions<\/h4>\n<table>\n<tbody>\n<tr>\n<td><b>Function<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">DDB<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It calculates the depreciation of an asset using the double declining method during a mentioned period.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">FV<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It calculates the future value of an investment.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">IPmt<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It calculates the interest for a payment for a loan.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">IRR<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It calculates the internal rate of return for periodic cash flows.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">MIRR<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It calculates the modified internal rate of return for periodic cash flows.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">NPer<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It calculates the number of periods for an investment.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">NPV<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It calculates the net present value of an investment.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Pmt<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It calculates the constant periodic payment for an investment.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">PPmt<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It calculates the principal of a payment during a mentioned period for an investment.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">PV<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It calculates the present value.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Rate<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It calculates the interest rate for an amount.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">SLN<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It calculates the straight line depreciation of an asset.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">SYD<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It calculates the sum of years depreciation for a mentioned period in the lifetime of an asset.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>11. VBA Array Functions<\/h4>\n<table>\n<tbody>\n<tr>\n<td><b>Function<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Array<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It creates an array containing a provided set of values.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Filter<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the subset of a provided string based on the criteria.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Join<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It joins the number of substrings into a single string.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">LBound<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the lowest subscript of an array.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Split<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It splits a text string into a number of substrings.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">UBound<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the highest subscript of an array.\u00a0<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>12. VBA File Management Functions<\/h4>\n<table>\n<tbody>\n<tr>\n<td><b>Function<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\"> CurDir<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the current path as a string.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Dir<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the directory\u00a0 name that matches the mentioned pattern and attributes.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">FileAttr<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the mode of the file that has been opened.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">FileDateTime<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the date when the file was lastly modified.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">FileLen<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the length of the provided file.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">GetAttr<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns an integer representing the attributes of a provided file or directory.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>12. Lookup or Reference Function<\/h4>\n<table>\n<tbody>\n<tr>\n<td><b>Function<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Choose<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns a value from the list based on the position.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>13. File or Directory Functions<\/h4>\n<table>\n<tbody>\n<tr>\n<td><b>Function<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">ChDir<\/span><\/td>\n<td><span style=\"font-weight: 400;\">This function helps to change the current directory or folder.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">ChDrive<\/span><\/td>\n<td><span style=\"font-weight: 400;\">This function helps to change the current drive.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">CurDir<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns the current path.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">MkDir<\/span><\/td>\n<td><span style=\"font-weight: 400;\">This function helps to create a new folder or directory.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">SetAttr<\/span><\/td>\n<td><span style=\"font-weight: 400;\">This function helps to set the attributes of a file.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>14. Logical Functions<\/h4>\n<table>\n<tbody>\n<tr>\n<td><b>Function<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">AND<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It evaluates to true if all conditions are true or else it returns false.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">CASE<\/span><\/td>\n<td><span style=\"font-weight: 400;\">This function has the functionality of an IF-THEN-ELSE statement<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">FOR..NEXT<\/span><\/td>\n<td><span style=\"font-weight: 400;\">This function helps to create the \u201cFor\u201d loop.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">IF-THEN-ELSE<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns a value if a specified condition evaluates to true or else the other value if it evaluates to false.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">OR<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It returns true if any of the conditions is met and it returns false if no condition is met in the criteria.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">SWITCH<\/span><\/td>\n<td><span style=\"font-weight: 400;\">This function evaluates a list of expressions and returns the corresponding value for the first expression in the list that is \u201ctrue\u201d.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">WHILE..WEND<\/span><\/td>\n<td><span style=\"font-weight: 400;\">This function helps to create the \u201cwhile\u201d loop.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>15. Related Page<\/h4>\n<table>\n<tbody>\n<tr>\n<td><b>Function<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Vlookup in VBA<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It uses the vlookup function in excel from within VBA.\u00a0<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Types of Arguments<\/h3>\n<p>There are different types of function with or without any arguments. Let\u2019s see some samples of it in different categories.<\/p>\n<h4>A. Creating a Function in VBA without Any Arguments<\/h4>\n<p>In the Excel worksheet, the user finds several functions that take no argument such as RAND, TODAY, NOW etc.<\/p>\n<p>These functions do not depend on any input arguments. For example, the RAND function will return a random number between 0 and 1.<\/p>\n<p>Note: The user can create such similar functions in VBA also.<\/p>\n<p>Let\u2019s see a sample.<\/p>\n<h4>Code:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Function WBName() As String\r\nApplication.Volatile True\r\nWBName = ThisWorkbook.Name\r\nEnd Function<\/pre>\n<h4>Code Explanation:<\/h4>\n<p>Here, this code will provide the name of the file and it doesn\u2019t take any arguments as it is not dependent on any argument. The function returns the result in a string data type.<\/p>\n<p>Note: If the user has saved the file then, it returns the name with the file extension or else it simply provides the name of the file.<\/p>\n<h4>B. Creating a Function in VBA with One Argument<\/h4>\n<p>Let\u2019s create a function where it takes only one argument in it. \\<\/p>\n<h4>Code:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Function UpperCase (CellRef As Range)\r\nUpperCase = UCase(CellRef)\r\nEnd Function<\/pre>\n<h4>Code Explanation:<\/h4>\n<p>Here, the function would convert the referenced text into uppercase. Though we already have a function for it in Excel, this is just a function to show you how it performs with one argument. In this function, we use the UCase function in VBA to convert the value of the CellRef variable. It then assigns the value to the function UpperCase.<\/p>\n<h4>C. Creating a Function in VBA with Multiple Arguments<\/h4>\n<p>Just like other worksheet functions, the user can create functions in VBA which take multiple arguments.<\/p>\n<h4>Code:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Function GetDataUsingDelimiter(CellRef As Range, Delim As String) as String\r\nDim Output As String\r\nDim De_Position As Integer\r\nDe_Position = InStr(1, CellRef, Delim, vbBinaryCompare) - 1\r\nOutput = Left(CellRef, DelimPosition)\r\nGetDataUsingDelimiter = Output\r\nEnd Function<\/pre>\n<h4>Code Explanation:<\/h4>\n<p>Here, the code would create a function that will extract the text before the specified delimiter. It takes two arguments and those are the cell reference that has the text string, and the delimiter.<br \/>\nNote: When the user needs to use more than one argument in a user-defined function, the user can have all the arguments separated by a comma in the parenthesis.<\/p>\n<h4>D. Creating a Function in VBA with an Optional Arguments<\/h4>\n<p>In Excel, there are many functions where some of the arguments are not really necessary, which we call optional arguments.<\/p>\n<p>For example, the vlookup function has three mandatory arguments and one optional argument.<\/p>\n<p>Note: The function with optional arguments works properly even if we don&#8217;t specify the optional arguments but if we don\u2019t enter the mandatory arguments then the function is going to give you an error. But optional arguments are also useful as they allow the user to choose from a range of options.<\/p>\n<p>For example: In the VLOOKUP function, if the user doesn&#8217;t specify the fourth argument, the function does an approximate lookup and if the user specifies the last argument as FALSE or 0, then it does an exact match.<\/p>\n<h4>E. Function with only Optional Argument<\/h4>\n<p>It is not easy to create a function only with the optional arguments. Eventually, there are no built in functions like that until now. But the user can create it with VBA.<\/p>\n<h4>Code:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Function CurrTime(Optional frmt As Variant)\r\n\r\nDim Result\r\n\r\nIf IsMissing(frmt) Then\r\n\r\nCurrTime = Format(Time, \"Hour-Minute-Second\")\r\n\r\nElse\r\n\r\nCurrTime = Format(Time, \"Hour:Minute:Second\")\r\n\r\nEnd If\r\n\r\nEnd Function<\/pre>\n<h4>Code Explanation:<\/h4>\n<p>Here in this code, the user uses the \u201cIsMissing\u201d to check whether the argument is missing or not. But if the user wants to use that particular statement then the argument must be of the variant data type.<\/p>\n<p>The above code creates a function that shows the time in the \u201c Hour-Minute-Second \u201d format if no argument is generally supplied and in \u201cHour-Minute-Second\u201d format when the argument is 1.<\/p>\n<h4>F. Function with Required as well as Optional Arguments<\/h4>\n<p>Now, we are going to create a function with the required as well as with the optional arguments in the function.<\/p>\n<h4>Code:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Function GetDataInText(CellRef As Range, Optional TextCase = False) As String\r\n\r\nDim DataLength As Integer\r\n\r\nDim Output As String\r\n\r\nDataLength = Len(CellRef)\r\n\r\nFor i = 1 To DataLength\r\n\r\nIf Not (IsNumeric(Mid(CellRef, i, 1))) Then Output = Output &amp; Mid(CellRef, i, 1)\r\n\r\nNext i\r\n\r\nIf TextCase = True Then Result = UCase(Output)\r\n\r\nGetDataInText = Result\r\n\r\nEnd Function<\/pre>\n<h4>Code Explanation:<\/h4>\n<p>Here, the code creates a function that separates the text part from a string. The results appear in uppercase if the optional argument is true or if it is omitted or false then it returns the result as is.<\/p>\n<h4>G. Creating a Function with Indefinite Number of Arguments<\/h4>\n<p>If a user is creating a new function then they might not be sure about the number of arguments that has to be supplied. Hence the requirement is to create a function that can accept as many arguments that are supplied and utilise them to return the result in the worksheet.<\/p>\n<p>An example of such a worksheet function is the PRODUCT function. The user can send multiple arguments to it such as<br \/>\n=PRODUCT(A1,A5:A10,B1:B10)<\/p>\n<p>The above function would multiply the values.<\/p>\n<p>Note: The keyword \u2018ParamArray\u2019 should be used before the optional argument. \u2018ParamArray\u2019 is a modifier that allows the user to accept as many arguments as they want.<\/p>\n<p>Now let\u2019s create a function that accepts an arbitrary number of arguments and would multiply all the numbers in the specified arguments:<\/p>\n<h4>Code:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Function MultArguments(ParamArray arglist() As Variant)\r\nFor Each arg In arglist\r\nMultArguments = MultArguments + arg\r\nNext arg\r\nEnd Function<\/pre>\n<h4>Code Explanation:<\/h4>\n<p>The above function can take any number of arguments and multiply these arguments to give the result.<\/p>\n<h4>H. Creating a Function that Returns an Array<\/h4>\n<p>The user can create a function that returns a variant that can contain an entire array of values in VBA. There are inbuilt functions to implement array formulas also.<\/p>\n<p>Let\u2019s see a sample<\/p>\n<h4>Code:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Function FourNumbers() As Variant\r\nDim NumberValue(1 To 4)\r\nNumValue(1) = 1\r\nNumValue(2) = 2\r\nNumValue(3) = 3\r\nNumValue(4) = 4\r\nFourNumbers = NumValue\r\nEnd Function<\/pre>\n<h4>Code Explanation:<\/h4>\n<p>Here, the user has specified the \u2018FourNumbers\u2019 function as a variant. This allows the user to hold an array of values. The variable \u2018NumValue\u2019 is declared as an array with four elements. It holds the four values and assigns it to the \u2018FourNumbers\u2019 function.<\/p>\n<h4>I. Exit Function<\/h4>\n<p>If the user creates a function that tests for a certain condition, and once the condition is found to be true, then they always set up a return value from the function. There are chances for them to add an Exit Function statement in the function in order to exit the function before the user has run through all the code in that particular function.<\/p>\n<p>Let\u2019s look at a sample.<\/p>\n<h4>Code:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Function FindNum(strSearch As String) As Integer\r\nDim n As Integer\r\nFor n = 1 To Len(strSearch)\r\nIf IsNumeric(Mid(strSearch, n, 1)) Then\r\nFindNum= Mid(strSearch, n, 1)\r\nExit Function\r\nEnd If\r\nNext\r\nFindNum= 0\r\nEnd Function<\/pre>\n<h4>Code Explanation:<\/h4>\n<p>The function will loop through the string until it finds a number and then returns the number from the provided string. The function will find only the first number in the string as it will then exit the function.<\/p>\n<h3>Things to remember<\/h3>\n<ul>\n<li>The user can use the built in functions in VBA for automating the process.<\/li>\n<li>While allocating and applying multiple macros, make sure you have assigned specific unique keys to run the macros.<\/li>\n<li>To avoid the confusion, name each module in VBA.<\/li>\n<\/ul>\n<h3>Summary:<\/h3>\n<ul>\n<li>A piece of code which performs some specific task is known as functions and it returns a value after execution.<\/li>\n<li>Functions help the user to break the code into smaller modules for better understanding of the code.<\/li>\n<li>The functions and subroutines can be called as many times as required and this saves a lot of time for the user from writing the same code repeatedly.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will learn about VBA Functions like Return, call and Examples. What is a Function? The term function refers to a code snippet which performs the specified task provided in the&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":103222,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24129],"tags":[25453,25448,25449,25451,25450,25458,25455,25457,25456,25454,25452],"class_list":["post-102261","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ms-excel","tag-built-in-vba-functions","tag-excel-vba-functions","tag-function-vs-subroutine-in-vba","tag-scope-of-a-user-defined-function-in-excel","tag-user-defined-functions-in-excel","tag-vba-array-functions","tag-vba-date-and-time-functions","tag-vba-financial-functions","tag-vba-math-and-trig-functions","tag-vba-program-flow-functions","tag-volatile-functions-in-vba"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Excel VBA Functions with Examples - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn what are functions in Excel VBA&gt; See various types of functions in VBA like program flow, date and time, array, financial, math and trig\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/excel-vba-functions-with-examples\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Excel VBA Functions with Examples - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn what are functions in Excel VBA&gt; See various types of functions in VBA like program flow, date and time, array, financial, math and trig\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/excel-vba-functions-with-examples\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-12T03:30:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-10-12T07:00:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/excel-vba-functions.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"24 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Excel VBA Functions with Examples - DataFlair","description":"Learn what are functions in Excel VBA> See various types of functions in VBA like program flow, date and time, array, financial, math and trig","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/excel-vba-functions-with-examples\/","og_locale":"en_US","og_type":"article","og_title":"Excel VBA Functions with Examples - DataFlair","og_description":"Learn what are functions in Excel VBA> See various types of functions in VBA like program flow, date and time, array, financial, math and trig","og_url":"https:\/\/data-flair.training\/blogs\/excel-vba-functions-with-examples\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2021-10-12T03:30:52+00:00","article_modified_time":"2021-10-12T07:00:30+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/excel-vba-functions.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"24 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/excel-vba-functions-with-examples\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/excel-vba-functions-with-examples\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9"},"headline":"Excel VBA Functions with Examples","datePublished":"2021-10-12T03:30:52+00:00","dateModified":"2021-10-12T07:00:30+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/excel-vba-functions-with-examples\/"},"wordCount":4777,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/excel-vba-functions-with-examples\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/excel-vba-functions.jpg","keywords":["Built-in VBA Functions","Excel VBA Functions","Function Vs Subroutine in VBA","Scope of a User Defined Function in Excel","User Defined Functions in Excel","VBA Array Functions","VBA Date and Time Functions","VBA Financial Functions","VBA Math and Trig Functions","VBA Program Flow Functions","Volatile Functions in VBA"],"articleSection":["MS Excel Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/excel-vba-functions-with-examples\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/excel-vba-functions-with-examples\/","url":"https:\/\/data-flair.training\/blogs\/excel-vba-functions-with-examples\/","name":"Excel VBA Functions with Examples - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/excel-vba-functions-with-examples\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/excel-vba-functions-with-examples\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/excel-vba-functions.jpg","datePublished":"2021-10-12T03:30:52+00:00","dateModified":"2021-10-12T07:00:30+00:00","description":"Learn what are functions in Excel VBA> See various types of functions in VBA like program flow, date and time, array, financial, math and trig","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/excel-vba-functions-with-examples\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/excel-vba-functions-with-examples\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/excel-vba-functions-with-examples\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/excel-vba-functions.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/10\/excel-vba-functions.jpg","width":1200,"height":628,"caption":"ms excel vba functions"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/excel-vba-functions-with-examples\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"MS Excel Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/ms-excel\/"},{"@type":"ListItem","position":3,"name":"Excel VBA Functions with Examples"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team is a group of passionate educators and industry experts dedicated to providing high-quality online learning resources on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. With years of experience in the field, the team aims to simplify complex topics and help learners advance their careers. At DataFlair, we believe in empowering students and professionals with the knowledge and skills needed to thrive in today\u2019s fast-paced tech industry. Follow us for Free courses, expert insights, tutorials, and practical tips to boost your learning journey.","url":"https:\/\/data-flair.training\/blogs\/author\/datafbdad\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/102261","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=102261"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/102261\/revisions"}],"predecessor-version":[{"id":103232,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/102261\/revisions\/103232"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/103222"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=102261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=102261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=102261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}