VBA Lesson 21: Functions in VBA for Excel
There are three topics in this lesson:
- using Excel functions within macros,
- using VBA functions within macros,
- creating new Excel functions with VBA.
Some of the functions that you find in Excel are available through macros in this form:
this sentence sums the values of cell A1 to A32 and stores the total in cell C1.
are two VBA functions that you will use within your Excel macros:
The " If" statements are case sensitive. When
you test a string of characters and you do not know if the user will enter upper case or lower case letters, use the LCase or UCase functions within your " If" statement so that however the user enters his answer the statement will work.
LCase(Selection.Value)= "yes" then...
UCase(Selection.Value)= "YES" then...
We hope you have enjoyed this introduction to lesson 21
for more on this topic and on Excel macros download the
Tutorial on Excel Macros
Go to the next lesson
Lesson 22 : External Data and SQL in VBA for Excel