Code Manipulation Flashcards
(13 cards)
What is breakpoint in VBA
Alt+F11 directly opens the editor
Press F5 to run the programme or code
The breakpointspecifies the line in your code where VBA should pause the execution of the macro operation when debugging the code. Specifying the breakpoint helps prevent VBA from running into a loop of IF statement. The shortcut key for adding a breakpoint is F9.
What is debug in VBA
Summary. VBA debugging isa process of locating and fixing errors, bugs, and other unintended features in the VBA code. VBA comes with various built-in debugging tools that can be used to find errors and bugs, thereby eliminating the need to recompile the code.
Alt+F8 runs the macro to run the macro in every sheet go to macro and run the code it will apply in all sheets.
What is syntax in VBA
The syntax in a Visual Basic Help topic for a method, function, or statementshows all the elements necessary to use the method, function, or statement correctly.
What is variable in VBA
Variable is a named memory location used to hold a value that can be changed during the script execution. Following are the basic rules for naming a variable. You must use a letter as the first character. You can’t use a space, period (.), exclamation mark (!), or the characters @, &, $, # in the name.
Key words in VBA code
AsAs keyword is used with Dim to specify the data type of a variable or argument.ByRefByRef keyword is used to pass variables or arguments into procedures and functions.ByValByVal keyword is used to pass variables or arguments into procedures and funct
Sub function in VBA
AsAs keyword is used with Dim to specify the data type of a variable or argument.ByRefByRef keyword is used to pass variables or arguments into procedures and functions.ByValByVal keyword is used to pass variables or arguments into procedures and funct
Ending key words
End with
End if
End function
End sub
Keys words in VBD code
Call
With
What
Replace
Objects and VBA intellitext
An objectrepresents an element of an application, such as a worksheet, a cell, a chart, a form, or a report. In Visual Basic code, you must identify an object before you can apply one of the object’s methods or change the value of one of its properties.
Intellitext
Intellitext helper box will pop up whenever u but . Dot after a know object.
Intellisense is basicallyauto-completionwhen you are typing. This displays a short description of member, function, arguments etc next to the cursor and is a convenient way to access functions, parameters, enumerations etc. Using intellisense speeds up development by reducing keyboard input.
Icons indicates whether it’s method or a property ,methods are little green moving box. Properties are little box little hand pointing at it.
How many types of variable
2 types simple type and objects
Simple type are single valued items like numerical value,
Variable Data Types
Integer: Used to store number values that won’t take on decimal form.
Single: Used to store number values that may take on decimal form. …
Double: A longer form of the single variable. …
Date: Stores date values.
String: Stores text. …
Boolean: Used to store binary results (True/False, 1/0
What is object variable
The object variablecontains only the memory address of the object. Using Set changes the address in the object variable. If an object is no longer referenced then VBA will automatically delete it. Setting an object to Nothing is not necessary in most cas
When to use the call code
When you are passing arguments into a subroutine, you need to pass them as a comma delimited list. The Call keyword can also be used here. Passing in parameters when using the Call keyword, does require the parameters to be enclosed in parenthe