Visual Basic

Arrays

Arrays 13.1 Introduction to Arrays By definition, an array is a list of variables, all with the same data type and name. When we work with a single item, we only need to use one variable. However, if we have a list of items which are of similar type to ...

Read More »

Creating VBA Functions For MS Excel

Creating  VBA  Functions For MS Excel 12.1 The Needs to Create VBA Functions in MS-Excel You can create  your own functions to supplement the  built-in functions in Microsoft Excel spreadsheet, which are quite limited in some aspects. These user-defined functions are also called  Visual Basic for Applications functions, or simply ...

Read More »

Introduction to VB Functions- Part II

Introduction to VB Functions- Part II 11.1 Creating Your Own Functions The general format of a function is as follows: Public  Function functionName (Arg As dataType,……….) As dataType or Private  Function functionName (Arg As dataType,……….) As dataType * Public indicates that the function is applicable to the whole program and ...

Read More »

Introduction to VB Functions Part I-Built-in Functions

Introduction to VB Functions Part I-Built-in Functions A function is similar to a normal procedure but the main purpose of the functios is to accept a  certain input and return a value which is passed on to the main program to finish the execution. There are two types of functions, ...

Read More »

Visual Basic – Looping

Looping Visual Basic allows a procedure to be repeated as many times as long as the processor could support. This is generally called  looping . Visual Basic allows a procedure to be repeated as many times as long as the processor could support. This is generally called  looping . 9.1  ...

Read More »

Select Case Control Structure

Select Case Control Structure In the previous lesson, we have learned how to control the program flow using the If…ElseIf control structure. In this chapter, you will learn  another way to control the program flow, that is, the Select Case control structure. However, the Select Case control structure is slightly ...

Read More »

Visual Basic – Conditional Operators

7.1  Conditional Operators To control the VB program flow, we can use various conditional operators. Basically, they resemble mathematical  operators. Conditional operators are very powerful tools, they let the VB program compare data values and then decide what action to take, whether to execute a program or terminate the program ...

Read More »

VisualBasic Assigning Values to Variables

Assigning Values to Variables After declaring various variables using the Dim statements, we can assign values to those variables. The general format of an assignment is Variable=Expression The variable can be a declared variable or a control property value. The expression could be a mathematical expression, a number, a string, a ...

Read More »

Writing the Visual Basic Code

In lesson 2, you have learned how to enter the program code and run the sample VB programs but without much understanding about the logics of VB programming. Now, let’s get down to learning some basic rules about writing the VB program code. Each control or object in VB can ...

Read More »

Working With Controls

Working With Controls 3.1 The Control Properties Before writing an event procedure for the control to response to a user’s input, you have to set certain properties for the control to determine its appearance and how it will work with the event procedure. You can set the properties of the ...

Read More »