Computer Programming in Excel VBA: Kwabena Ofosu, PH.D., P.E., PTOE
Computer Programming in Excel VBA: Kwabena Ofosu, PH.D., P.E., PTOE
Part 1: An Introduction
by
Abstract
This course is the first of a four-part series on computer programming in Excel Visual Basic for
Applications (VBA), tailored to practicing engineers. In this course, a general overview of
computers and computer programming languages is presented. A tour of the Excel VBA
programming environment follows. The concept of variables is presented as it specifically relates
to the VBA programming language. Several examples relevant to engineering are used to
illustrate and demonstrate the concepts and methods learned in this class. Two mini-projects are
used to demonstrate the programming concepts and methods in situations encountered by
practicing engineers.
TABLE OF CONTENTS
Abstract ........................................................................................................................................... 2
List of Tables .................................................................................................................................. 4
List of Figures ................................................................................................................................. 5
1. INTRODUCTION ...................................................................................................................... 6
1.1 Computers ............................................................................................................................. 6
1.2 Computer Programming........................................................................................................ 7
1.3 Relevance of Computer Programming.................................................................................. 9
1.4 Planning Computer Programming Solutions ........................................................................ 9
1.5 Visual Basic ........................................................................................................................ 10
2. THE VBA ENVIRONMENT ................................................................................................... 11
2.1 Opening the VBA Environment.......................................................................................... 11
2.2 A Tour of the VBA Environment ....................................................................................... 16
2.3 First VBA Project ............................................................................................................... 27
3. WORKING WITH VARIABLES ............................................................................................ 55
3.1 Variables ............................................................................................................................. 55
3.2 Data Types .......................................................................................................................... 55
3.3 Rules for Naming Variables................................................................................................ 57
3.4 Variable Name Conventions ............................................................................................... 57
3.5 Variable Declaration ........................................................................................................... 58
3.6 Scope of a Variable ............................................................................................................. 62
3.7 Order of Operations ............................................................................................................ 70
3.8 Second VBA Project ........................................................................................................... 70
4. CONCLUSION ......................................................................................................................... 90
REFERENCES ............................................................................................................................. 91
List of Tables
List of Figures
Figure 2: Plan and sketch for First VBA Project .......................................................................... 27
Figure 4: Plan and sketch for Second VBA Project ...................................................................... 71
1. INTRODUCTION
1.1 Computers
A computer can be defined as an electronic device that has the ability to accept, manipulate,
process, store, retrieve, and output data according to programmed instructions. A computer
consists of two basic parts a) the Hardware: the physical components of the computer, such as
the monitor, keyboard, mouse, etc., and b) the Software: any set of instructions that tells the
hardware what to do, e.g. web browsers, games, and word processors, etc.
The central processing unit (CPU) is the hardware component of a computer that carries out
the instructions by performing the basic operations such as data input, arithmetic, logic, and
output of results. The CPU is essentially the physical “brain” of the computer. The memory of a
computer refers to the hardware used to store the instructions and data on a temporary or
permanent basis. The storage of a computer refers to physical components and recording media
used to retain the data in electronic format on a long term basis.
The operating system (OS) of a computer is software that manages and coordinates the
computer's memory, storage, processes, and all of its software and hardware. Modern operating
systems use a Graphical User Interface (GUI, pronounced "gooey") to enable a human user to
interact with the computer. It is the GUI that enables a user to click on icons, select buttons,
menus, checkboxes etc., and have results displayed back to the user on a screen using graphics,
text, or some combination thereof. Currently, the most common operating systems in use for
personal computers are Microsoft Windows, Apple Mac OS X, and Linux.
The flow of data during the interaction of a human user and a personal computer can be depicted
schematically as in Figure 1. When a user selects a task to be performed, for example, by
clicking with the mouse, using the keyboard, or by using some other input device, instructions
are sent to the CPU via the memory to be processed and implemented. Computers are not
designed to understand instructions in ordinary everyday language. The instructions sent to the
CPU are written in a computer programming language, (also called a programming language).
An element of the CPU called the compiler, converts these programmed instructions (commonly
called source code or code) into machine language. Machine language consists of binary data
(zeros and ones). Computers are built to understand and respond to machine language. The
instructions can now be implemented and the results sent to an output device such as a monitor
for display, or to a printer.
OUTPUT DEVICE
INPUT DEVICE
(keyboard, instructions in MEMORY instructions
mouse etc) programming in machine
language language
Monitor
COMPILER
CPU
Printer
:
:
:
Figure 1: Flow of instructions in a computer
Currently, there are literally hundreds of programming languages in use, each one developed to
address a particular type of problem. Programming languages can be classified in many ways.
One common approach to classification is based on the paradigm or approach to the
Some of the more common and widely used programming languages include:
C (object-oriented programming language)
C++ (object-oriented programming language)
Java (object-oriented programming language)
Visual Basic (event driven and object-oriented programming language)
Python (object-oriented and procedural programming language)
Ruby (object-oriented programming language)
Pascal (procedural programming language)
Matlab (procedural programming language)
Fortran (procedural programming language), and many others.
The choice of what programming language to use on a specific project is determined by several
factors such as:
the operating system of the end user(s)
the programming approach that is relevant, procedural programming or event-driven, etc
how well the structure and features of the language are compatible with the project goals
the level to which the program will be used to manipulate hardware components e.g. in
video games
the ease with which new features can be added to the existing program
the skill set of the programming team
support for, and community standing behind the language
The question often arises as to why engineers and scientists should learn computer programming.
Engineers, for instance, are generally required to take just an introductory level computing class
as college freshmen. They generally do not receive any further formal instructions on the subject
and may not be required to apply it in any other classes for the rest of their entire undergraduate
work. Effectively, by graduation, the programming class is a distant memory of questionable
relevance, and yet computer programming is becoming an increasingly advantageous and
necessary skill set for engineers and scientists competing in the global economy. By writing
computer programs to automate tedious and repetitive tasks such as design calculations, or
preparing, processing and analyzing large amounts of data which would otherwise be done by
hand, engineers and scientists can drastically increase their productivity and efficiency.
Competence in computer programming predisposes engineers and scientists to pursue and
develop more creative and innovative solutions than their peers. Knowledge, and some level of
experience in computer programming enables engineers and scientists to communicate more
effectively with full-time programmers and information technology professionals they may work
with and collaborate with on various projects.
The VB language comes in several “dialects”. One such dialect is Visual Basic for Applications
(VBA). VBA is used as a macro or scripting language within the Microsoft Office suite of
products. VBA is also used in many third-party products widely used by engineers and scientists
such as SolidWorks, AutoCAD, and ArcGIS.
In this class the fundamentals of computer programming will be presented using the VBA
language accessed from Microsoft Excel.
If the user has never used the VBA environment in Excel before on their computer, it must be
activated using the following steps:
Step 4: Check the box to Show Developer tab in the Ribbon. (For Excel 2010 and above, users
will select Customize Ribbon, and check the box beside Developer). Click OK.
The Developer tab is now activated in the Excel session and will remain as such in perpetuity
unless the user follows the procedure to deactivate it, or if the computer is for some reason reset
to original factory settings.
Step 7: Click on Insert, and then select UserForm. The user is now ready to begin developing a
VBA application.
Toolbox
Form
Project Explorer
Window
Properties
Window
UserForm
The Form or UserForm is the backbone upon which the application will be built. The toolbox
contains controls. Controls are the text boxes, drop down menus, check boxes, push buttons etc.
To build the user interface of the application controls are dragged from the toolbox onto the form
and arranged as needed. The UserForm may be resized as needed by hovering over a handle to
get the two headed arrow, clicking and dragging to desired size.
Toolbox
Some of the controls that can be added from the toolbox include label, text box, picture box,
image, scrollbar, combo box (drop down menu), check box, radio button (option button), and
many others.
Properties Window
The UserForm and controls are objects. Following from the fundamentals of object-oriented
programming, the objects have properties and methods associated with them. By clicking on a
control that has been placed on the UserForm, the properties of the object can be changed and
modified from the Properties Window. The properties of a control listed in the Properties
Window include Name, Caption, Font, Text Alignment, Value, and many others. The properties
may be viewed alphabetically, or by category.
In the Project Explorer Window, Select the UserForm and click on View code.
The current UserForm has no controls on it and no code has been written for it at this time
therefore the code window appears blank.
To view the object again, click on View object
View Menu
Other windows are available through the View menu. If a window is inadvertently closed, it may
be reopened from the View menu
Format Menu
The Format menu provides quick means to format, arrange, order, and align controls on a form.
Debug Menu
This menu provides means to check the code, identify and highlight errors in the code, and
modify some areas in the code.
Run Menu
VBA has three modes, namely design time, run time, and break time. This VBA session is
currently in design time (or design mode). This is the mode in which the application is being
built and code is being written. When the application is actually running, being tested, or are
codes being executed, it is it run time. Once in run time, if for some reason the program pauses
or if there is a run-time error, the program goes into break time. In break time the program can
be debugged, saved, updated, modified etc, and the run time can be restored from where it
paused or it can be restarted. From break time the program can be reset and it will go back to
design time for further work.
The Run menu enables a user to manually switch through the modes.
Tools Menu
The Tools menu provides access to additional programming options, additional form controls,
and setting up security features such as password protection, and locking the project from editing
by a third party.
Help
The Help menu provides access to vast help resources online such as search engines, user
forums, libraries, and knowledge banks, through the Microsoft website, and the Microsoft
Developers Network (MSDN). Click on each one.
Click Help
Select MSDN on the web
A simple project will be developed to demonstrate the use of forms and controls.
Problem Statement:
An engineer is required to attend up to four professional development events in a year in order to
obtain approval for license renewal. Create a GUI on which the engineer can enter their personal
information and a list of professional development events they attended and the hours they have
earned over the renewal cycle. The GUI will have a button which when clicked will save the
information entered onto a spreadsheet. Add another click button that clears all the information
entered on the form as well as that saved to the spreadsheet. Add a third button that will
terminate the program.
Solution:
Step 1: Plan the project
A proposed sketch of the user interface based on the requirements in the problem statement is as
follows:
Labels
Text boxes
Command buttons
Step 2: Algorithm.
Based on the problem narrative, the following flow chart is deduced.
START
Enter or update
personal and
training
information
Select Select
option option
Click a
button
Click Click
Save Clear
Click
Close
STOP
In the properties for the UserForm, look up the Caption property and change it to read “PDH
TRACKER APP”. Note that the Caption property determines the text in the form banner, but the
name of the control (form) remains UserForm1. All controls can be manipulated in this manner.
The actual name of the control can be changed in the Name property.
From the Toolbox click and drag one label, one text box and one command button onto the
form.
Notice that the Properties Window is now showing the properties of the currently selected
control.
Click on and drag the command button control to the desired location on the form.
Select Label1.
In the Properties window change the Caption to read “Name”.
Alternately hover over the label control and then click on the Caption text “Label1” to highlight
it.
Type over it the new Caption “Name”.
Change the font size of the “Name” label to provide more clarity.
Add more controls to the form, and click and drag on them to reposition and arrange them
accordingly to match the layout from the earlier planning stage.
Alternately select a control and make copies of it by Copy and Paste.
Multiple controls may be selected by holding down the Shift key and clicking on each control to
select them. The multiple controls selected may be copied and pasted as one block.
The form as well as the controls may need to be resized accordingly.
The properties of multiple controls can be changed in one operation given the same property is
being changed on all the controls selected.
Select all the column header labels.
In the Properties Window select Font.
Change the Font Style to Bold.
The UserForm goes into run time. If code has been written, it will be executed when the
appropriate button is clicked on.
Click to leave
run time and
return to design
time
So far the file and VBA application have not been saved.
To save, from the VBA environment, click on Save.
Select a folder, give the file a name.
In the Save as Type, select Excel Macros-Enabled Workbook.
Click on OK.
The Macros-Enabled Workbook is an Excel file which has VBA code and applications added by
the user. Macros–Enabled Workbooks can be distinguished from other Excel files by their logo.
Macros-Enabled
Workbook
At this time, code can now be written for the controls. From the flow chart it can be seen that the
events in this program are associated with the command buttons. Code needs to written to control
the behavior of the controls once a command button is clicked on.
Unload Formname
where
Formname is the name of the form.
The name of the form may be looked up by clicking on the form and reviewing the Name
property in the Properties Window. In this case the correct code would be
Unload UserForm1
To associate this code with the Exit button, select the Exit button and click on View Code, or
simply double click on the Exit button to go straight to the code window for procedures related
to this control.
The Exit button in this project is CommandButton3.
Object Procedure
Code written here is
what will happen
when this object is
clicked on
Type the code to close the UserForm in the click event procedure for CommandButton3.
Add a comment line to remind the programmer what this code will do when executed.
In VBA to create a comment type the apostrophe. Anything typed to the right of the apostrophe
on that line becomes a comment. The compiler recognizes comments to be informational
statements by and for the programmer and does not attempt to execute them. Comments are
extremely useful particularly in large and complex programs. Comments provide a simple and
plain way for a third party to follow what the program is doing by reading them. The rule of
thumb is to write as many comments as necessary.
comments
code to close
the form
In some cases, an instruction (command) may be too long to fit laterally on the screen and it
would be desirable for the programmer to type the command over multiple lines. This can be
done by creating a line break. In VBA, a line break is created by typing a space (Spacebar on
keyboard), followed by underscore (Shift + hyphen key), followed by enter (Enter key) to go to
the next line, even though technically, to the compiler, the cursor is still on the same line.
Before running the code check for any syntax errors. A syntax error is an error that occurs due
to typing incorrect code as per the rules of the programming language being used. Syntax errors
may be caused by typographical errors, misspelling, omission of characters etc.
Checking for syntax errors can be done rapidly by selecting the Debug menu, and selecting
Compile VBAProject.
If the code contains errors or omissions, those areas in the code will be flagged for attention.
Once the Compile VBAProject produces no further errors, the program may now be tested.
Now click on the Exit button. The form closes as expected, and sends the user back to design
time.
To view other objects in this project click on the objects drop down.
To see other procedures and associated code relevant to any object, click on the events
dropdown.
Sheets(“sheetname”).cells(i, j)
where
sheetname is the name of the spreadsheet
i is the row number of the cell on the spreadsheet
j is the column number of the cell on the spreadsheet
Sheets(“Sheet1”).cells(3, 4)
Sheets(“sheetname”).cells(i, j).value
UserFormname.controlname
UserFormname.controlname.value
So for a Textbox1 on a UserForm1, the reference to the text box and to its value would
respectively be
UserForm1.TextBox1
and
UserForm1.TextBox1.value
To save a text box value to a cell on the spreadsheet the assignment operator, the equals sign, is
used, as follows.
destination = origin
In other words the value of the right hand side of the equality sign will always be assigned to the
destination on the left hand side, and never vice versa.
Based on the following framework on the spreadsheet, and the framework established on the
UserForm1, some of the control-to-cell assignments will be as follows
Sheets(“Sheet1”).cells(5,5) .value
Sheets(“Sheet1”).cells(5,1) .value = UserForm1.TextBox7.value
= UserForm1.TextBox4.value
Sheets(“Sheet1”).cells(5,7) .value
Sheets(“Sheet1”).cells(5,2) .value
= UserForm1.TextBox8.value
= UserForm1.TextBox5.value
The code for the Save button will therefore be a compilation of these control-to-cells
assignments.
In the design window double click on the Save button to open its click Procedure.
In the click procedure, list all the assignment statements.
Add comments to enhance clarity and for a third party to be able to review the code with
minimal problems.
There are number of ways to clear the entry in a control, or change the object value property
value to “blank”.
Sheets(“sheetname”).cells(i, j).ClearContents,
e.g. Sheets(“Sheet1”).cells(7,1).ClearContents
Alternately, for the spreadsheet, a range of cells can be specified and then contents erased. The
syntax would be
A combination of all of the above will be used to clear the spreadsheet and the form entries in
this example.
Double click on the Save button from design time to open up the procedure for it.
Type the code to clear the contents of all controls on the form.
Also clear the spreadsheet entries.
3.1 Variables
A variable is area of computer memory allocated to hold data of a certain type. A simplistic
analogy is a mailbox in a corporate office staff room. The mailbox for each employee must have
a unique identification and will be restricted by its physical size to holding a certain kind or type
of mail delivery. Once a variable is set up, its content will become the value of the variable.
When the variable is called for some calculation, its value will be inserted into the calculation
process. In programming, variables are necessary to facilitate calculations and data
manipulations that otherwise will be difficult or inefficient to do by directly using the values of
the form controls.
VBA supports several data types. Each data type has a range of values it can store, and consumes
a specific amount of computer memory in doing so. Programmers must choose the appropriate
data type, keeping in mind the impact it will have on the computer’s resources, and the speed and
smooth running of programs. Table 1 summarizes the data types supported by VBA.
As programs get large and complex it becomes advantageous to establish a name convention to
manage the variables. Following a name convention can make it easier to identify the type of the
variable. It will also make the code easier to figure out when it is reviewed by a third party or
revisited after an extended period of time. For programs and applications developed by multiple
individuals or teams of programmers, adopting a common name convention for variables will
provide a common platform for communication and prevent confusion.
Different programming languages are amenable to different name conventions. One common
convention used in VBA is to append a three letter prefix that indicates the data type of that
variable, in lower case letters, and the variable name proper starting with an uppercase letter.
Optionally, especially for larger and yet more complex programs, the prefix can be extended to
include the scope (described in Section 3.6) of the variable. Table 3 shows examples of
commonly used prefixes based on data type.
Variable declaration is the process of assigning a name and type to a variable. By default,
variable declaration is required before a variable can be used in a procedure, otherwise a run-
time error will occur. When a variable is declared, an area of memory is reserved for it and
assigned a name, the name of the variable. It is then ready to accept and store data of the type
specified in the declaration statement.
Examples:
Multiple variables can be declared at once provided they are of the same type.
The default data type in VBA is variant. In other words if a data type is not specified it will be a
variant type by default.
Alternately, in the code window typing Option Explicit at the top of the window will require
that all variables be declared before using them.
Variable declaration facilitates writing clean, strongly typed code, and simplifies debugging.
Variable declaration saves overall programming time and eliminates the source of the most
common and unnecessary bugs. In this course the variable declaration requirement will be
applied at all times.
A variable that is declared within a procedure or function is called a local variable, and only
exists while that procedure or function is executing. Once the procedure completes execution, the
variable ceases to exist.
A global variable on the other hand exists independently of any specific function or procedure.
Any function or procedure in the module may use it or modify it. A global variable stays “alive”
as long as the VBA module (e.g. an open form) it is associated with is active. Global variables
are declared outside of any procedure or function, at the top of the code window, below the
Option Explicit line.
Some applications may consist of multiple modules (forms), and it may be necessary that a
variable (global variable) manipulated in one form be available or called in or from another
active module, or vice versa.
For example, consider a maintenance activity form filled out by a field crew leader.
Upon the supervisor selecting their last name from the supervisor list, a log-in form opens asking
the supervisor to enter their name and password.
Upon correctly entering the password, the approval will be confirmed, otherwise it will be
denied.
For this to work, a global variable is needed for the two forms to be able to exchange
information. In this case a global variable named strGstring, a string type, will be used.
The variable strGstring is now available for manipulation from and by any module (form) in the
workbook.
In this example, the value will be assigned with the Approved_By control entry on the main form.
The variable is then called by the log-in form and will be used for confirmation in the log-in and
password process.
The arithmetic operations that can be performed in VBA include addition, subtraction,
multiplication, division, and exponentiation. The order of operations determines the order in
which arithmetic operations will be performed in a mathematical expression. The order of
precedence for arithmetic operations is as follows:
1st. Exponentiation
2nd. Multiplication and division
3rd. Addition and subtraction
If the above result was not the original intent, but rather to conduct the addition first, then
parenthesis will have to be inserted appropriately to control the calculation. In the VBA code,
type:
(2+3)*6^2
It must be noted that VBA does not support implied algebraic operations so for example the
expression 3(X-Y) will not be syntactically valid in VBA. It will have to be typed as 3*(X-Y)
where X and Y are variables that have been declared earlier in the code.
Problem Statement:
Create a calculator to assist a construction engineer in calculating material costs based on the
unit price of the material and the quantity of material to be ordered. The calculator will have
three line items with a subtotal for each item. The calculator will have a click button to calculate
the subtotal and another click button to calculate the grand total. Add a button that will clear all
entries if the user would like to start afresh. Provide a button that will close the application when
clicked on.
Solution:
label
text box
command button
START
Enter unit
price and
quantity for
item i
‘i < 3 Yes
No
Calculate:
Subtotal1
Subtotal2
Subtotal3
STOP
Double click on the Sub Totals button (CommandButton1) to open the code window.
In the click procedure for CommandButton1 (Private Sub CommandButton1_Click( ) ), declare
variables (using appropriate names of your choice and following variable name rules and
convention) to hold Unit Price, Quantity and Subtotal for each line item.
Declare a global variable that will hold the sum of the subtotals.
Save your work.
Now the variables need to be assigned values. In other words e.g., “…where is the value for
curUnitPrice1 coming from?” It is coming from the Textbox1 value. So the Textbox1 value
needs to be assigned to the curUnitPrice1 variable.
Assignment is done using the assignment operator, the equals ( = ) sign. In this case:
curUnitPrice1 = UserForm1.TextBox1.value
Note that the origin will always be on the right hand side and the destination on the left hand
side, and never vice versa. In other words the right hand side information is being sent to the left
hand side for storage.
UserForm1.TextBox1.value = curUnitPrice1
It would mean the value stored in the variable curUnitPrice is being sent to the TextBox1, and
since Textbox1 is a control on the form, the value of the variable curUnitPrice would be
displayed on the form in Textbox1. This is a diametrically opposite result from the original
intent. However it is important to note that there will be cases where such a result is desired. In
this problem for example, after calculating the grand total using the relevant variable(s), it shall
be displayed on the form. So the “reverse” assignment statement will be the correct one in that
case.
Returning to the variable assignment step, assign the values for all variables that will be used in
the calculation of the subtotals when the Sub Totals button is clicked.
The calculations for the subtotal of each line item involves multiplying the corresponding
variables holding the Unit Price and the Quantity for that line item.
UserForm1.TextBox3.value = curSubTotal1
The grand total button will be used to display the grand total on the form. This is therefore the
end of the Subtotals procedure (clicking on CommandButton1). As with all procedures it shall
run from top to bottom. Once it ends, the local variables will cease to exist. The curTotal
variable however will continue to “live” as long as the form is active. This is because it is a
global variable (module-level) and continues to exist with its current value regardless of which
procedure is executing or not, even though its value came from one such procedure which has
run to termination.
Click Debug.
Select Compile VBA Project.
Address any errors that are highlighted.
If none, save the workbook as an Excel Macros-Enabled Workbook.
Total button
The grand total has already been calculated in the Subtotals procedure using a global variabe.
Since the form is still active, that global variable still exists and holds the value we are looking
for. Assign the curTotal variable to its display text box.
Double click on the Grand Total button to go Commanbutton2_click ( ) procedure.
Reset button
The Reset button will revert the input text boxes to zeros. It will then clear contents in the
subtotals and grand total text boxes.
Exit button
The Exit button closes the application.
Click Debug
Select Compile VBA Project
A Run-time error occurs. It says “Type mismatch”. This means a variable is being asked to
hold a data type different from the type in its declaration statement.
Click Debug to go to the line of code where the compiler encountered the problem.
The line where the problem caused the execution to break (pause) is highlighted by the
compiler.
Hovering over the variable names, the cursor tip shows the current value of the variable. In this
case curUnitPrice 3 shows a null value. Yet a value was assigned to it, or so it was thought.
Study the code carefully. curUnitPrice3 was assigned the TextBox6 value, this is incorrect. It
should be assigned the value in TextBox7. dblQuantity3 shall be assigned the value from
TextBox8, not TextBox7.
Compile your code again through the Debug menu
After making all of these changes, click on the Reset button in the VBA toolbar.
Reset
Click on Reset.
Success. The data entries clear as expected.
4. CONCLUSION
This course has presented a broad overview of fundamental concepts and principles of computer
programming, and presented them in situations encountered by practicing engineers and
scientists. All codes were developed using the Excel Visual Basic for Applications (VBA)
programming language.
This course, the first of a four-part series, covered an introduction to computers and computer
programming languages, the Excel VBA programming environment, and the concept of
variables and how they are applied in VBA.
This course has enabled participants to identify situations where programming is relevant and
will be of advantage to the professional. Practitioners are strongly encouraged to look out for
situations in their domains of expertise where programming solutions are applicable and will be
of benefit to their work and their organization.
Computer programming requires a careful and meticulous approach, and can only be mastered
and retained by practice and repetition.
REFERENCES
Bradley, J. C., & Millspaugh, A. C. (1999). Programming in Visual Basic 6.0. Irwin McGraw-
Hill.
FunctionX Inc. (2013). VBA for Microsoft Office Excel 2007. Retrieved December 21, 2013,
from FunctionX Tutorials: www.functionx.com/
Microsoft. (2013). Excel 2013 developer reference. Retrieved October 15, 2013, from Office
Dev Center: http://msdn.microsoft.com/en-us/library/office/ee861528.aspx