-
8
pages
-
English
-
Documents
Description
KING FAHD UNIVERSITY OF PETROLEUM & MINERALS Accounting & MIS Department MIS105- Introduction to Computer Applications Instructor: Irfan Ahmed Ilyas 1. Use of Visual Basic for Applications (VBA) code Some important information about VBA: • VBA stands for Visual Basic for Application. • It is an event driven programming language (different objects can respond to different events like mouse click, double click, etc.) • VBA code is developed in units called procedures or module. • These event procedures (a set of VBA commands) are attached to some object’s event. • A VBA procedure starts with the reserved word Sub and ends with End Sub. • VBA is used for more or less the same purpose as macros are having. However a VBA code allows more control over the application behavior then a macro does, in terms of. 1. Data validation (e.g. password checking etc.) 2. Dynamic alteration of Object Properties 3. Facilitating Data entry 4. Enhanced Communication with User Where to start in VBA coding? Whenever you are asked to write a VBA code for some situation, you are supposed to find out the following two answers. Question#1. Which object (button, list box, etc) is supposed to provide the needed functionality Question#2. Which specific event of the object (identified in Question#1) the code (VBA procedure) should be linked [for example, a button object a “mouse click” is mostly used]. For example, In a situation where you are asked to provide a ...
-
Publié par
-
Langue
English