Excel VBA is the coding language of Excel. VBA stands for Visual Basic for Applications and is actually Microsoft’s general programming language for all Office Applications What is VBA
Objects in VBA Macros
This course concentrates on you writing VB Code. You will learn to create Automations In Excel For Example; How to get Data from multiple Excel files and make a single file our of them, by a click of a Button. Macro Recording Complete Complex task Reusable Code Speed Work What will you Learn
MsgBox
Comments
InputBox
Assign a macro to a Button Select the macro name Click on OK Button Invoking a procedure
Remarks: Turn screen updating off to speed up your macro code. You won't be able to see what the macro is doing, but it will run faster. Remember to set the Screen Updating property back to True when your macro ends. Application.screenUpdating
User - Defined Functions(UDFs)
Just like a built-in function, a UDF is a pre-defined formula which can be executed in the same way. The difference is that you design the definition using VBA. In this way you can define functions which do not exist as built-in functions, but which you may need to use frequently. What is a UDF?
You use a UDF for the same reason as a built-in function, namely to make calculations (operations) which are repeated more efficiently. Before writing a UDF make sure that it does not already exist as built-in Excel function! When and why do you use a UDF?
Function name [(arguments) [ As type] ] [ As type] [statements] name= expression [ End Function ] User Defined Function Syntax:
Function multi2num(x As Integer,y As Integer) As Integer Multi2num = x + y End Function Example :
Write a Function to check whether the number is Even or Odd. Write a function for number between 1-17 should return “young”, 18-40 should return “middle age” and above will be Senior Citizen. Write a Function for Cube of a Number Exercise