

Here in the above coding, we have named the function as “todayDate” and the coding will be displayed as: Once we click on the module a new module will be added in the worksheet and on the right-hand side of General page, we will write the VBA function coding. Insert a new Module as we have discussed above in Example 1.

In VBA, date function is a built-in function DATE() which return date and time we will now use the date function to get the date in the particular sheet. Let us now see how to use VBA function in Excel with the help of some examples. Now – Returns the current date and time.Is Null – Which will check for the supplied value is null or not.Is Empty – Which will check for the specific variant is empty or not.Is Date- Which will check for the supplied expression is date format.Is Array- Which will check for the supplied value is an array.Replace – Which will replace the specific string with another string.Len- Which returns a length of the string.Format- Which applies format for the specific string.Msg Box- Which displays Message box i.e.Input Box- Which displays an input dialogue box.We will see the mostly used VBA function which is listed as follows. Visual basic contains a large number of built-in function like Message Function, String and Text Function, Information Function, a Conversion function, Date and Time, Math and Trig Functions, Financial function If it returns the control it will also return a value to the specific code. This function normally performs a task and then returns controls to the calling code. A function is nothing but a collection of visual basic statements enclosed by start and an end function. In Visual Basic, we will use the various function. In the Right-hand side where we can use the UDF function using VBA.Now we can see that new module has been added as MODULE 1 on the left-hand side of the panel.Right-click on your workbook name in the ” Project VBAProject” pane (at the top left corner of the editor window) and select Insert -> Module from the context menu as shown below.Use the shortcut key ALT+F11 to open Visual Basic Editor which is also called as VBE in excel shown in the below screenshot In Excel, VBA workbook can be added easily by following the below steps. Now we can see that the “ Developer” Tab is added and it has the features like VISUAL BASIC, MACROS, etc. Once you check mark the “ DEVELOPER” Tab it will get added in excel menu which is displayed as follows.Here we can see that on the “Right-hand side” of the customize ribbon “ DEVELOPER” Tab is not checked. Checkmark that “DEVELOPER” Tab and click OK In customize ribbon option we can see add or remove the ribbon manually.Select Customize Ribbon option and we will get the below dialogue box as follows.
