By using the shortcut key ie AltF11. Once we click on the module a new module will be added in a worksheet Where we will write the VBA. The function can then be defined as a data type indicating the type of data you want the function to return.
Go to Insert Menu and select module.
Open your workbook in Excel. Once we click on the module a new module will be added in a worksheet Where we will write the VBA. To create a function you need to define the function by giving the function a name. IF OR Function in VBA.