Introduction to VBA

10
Introduction to VBA

description

Introduction to VBA. What is VBA?. VBA stands for Visual Basic for Applications . It is a programming language used exclusively by the Microsoft Office to extend abilities of Microsoft Office Application . - PowerPoint PPT Presentation

Transcript of Introduction to VBA

Page 1: Introduction to VBA

Introduction to VBA

Page 2: Introduction to VBA

What is VBA? VBA stands for Visual Basic for

Applications. It is a programming language used

exclusively by the Microsoft Office to extend abilities of Microsoft Office Application.

In Excel it is used when you need something more complex than Excel's formulas and functions allow. VBA allows you to create very sophisticated Excel spreadsheets.

VBA is different from VB 6.0 or VB.NET

Page 3: Introduction to VBA

Visual Basic (Definition)

What is Visual Basic? Visual Basic is a "visual programming" environme

nt for developing Windows (also Web now) applications. Visual Basic makes it possible to develop complicated applications very quickly.

Visual Basic is "event-driven” programming language.

You must have Visual Studio installed in your computer in order to write the code.

Page 4: Introduction to VBA

Visual Basic (History)

History of Visual Basic Microsoft first released Visual Basic in 1987. It

was the first visual development tool from Microsoft, and it was to compete with C, C++, Pascal and other well-known programming languages.

From the start, Visual Basic wasn't a hit. It wasn't until release 2.0 that people really discovered the potential of the language, and with release 3.0 it had become the fastest-growing programming language on the market.

Page 5: Introduction to VBA

Visual Basic (History) Approximate year in which a new version of Vi

sual Basic was released: 1991, VB1 1992, VB2 1993, VB3 1996, VB4 1997, VB5 1998, VB6 2001, VB.NET

Page 6: Introduction to VBA

VB.NET

Visual Basic .NET (VB.NET) is an object-oriented computer language that can be viewed as an evolution of Microsoft's Visual Basic (VB) implemented on the Microsoft .NET framework.

Page 7: Introduction to VBA

Visual Basic vs. Visual Basic for Application

Visual Basic 6.0,

Visual Basic .NET

Visual Basic for Application (VBA)

- It is not just for Microsoft Office Application, but for creating any type of software.

- It already comes with any Microsoft Application (such as word, excel, access, etc).

- Need to install Visual Studio on your computer.

- Don’t need to install Visual Studio.

- It is designed to use exclusively with Microsoft Office Application to enhance ability of Microsoft Applications.

For VB 6.0, VB.NET or VBA, they all are based on Visual Basic Language!!!

Page 8: Introduction to VBA

VSTO (Visual Studio Tools for Office)

VSTO, or Visual Studio Tools for Office, or Microsoft Visual Studio Tools is part of Microsoft's Visual Studio .NET tools suite and supports the Microsoft .NET Framework.

To use VSTO, you need to have visual studio .NET installed in your computer.

It is used by developers to write code connecting to Microsoft Office Word, Excel and Outlook applications.

It is an alternative to Visual Basic for Applications, or VBA

Page 9: Introduction to VBA

Example: Excel VBA

As example, we will build a UserForm that allows users to enter the contact information into a form and save to an Excel worksheet. What you have to do is just open an Excel. In the "Tools" menu, select "Macros" and then "Visual

Basic Editor". Go to the "Insert" menu and click on "UserForm". A blank

user form and a toolbox will appear. Put objects you need on to the form Write VBA code for your button Please see http://spreadsheets.about.com/od/

excel101thebasics/l/blexuserform1.htm for more information on this example.

Page 10: Introduction to VBA

For more information….

Search by any search engine using keyword such as “ VBA, Tutorial”

Or Go to http://spreadsheets.about.com/od/excel101thebasics/l/blexuserform1.htm for information of Excel VBA

Or any Microsoft Office book (look at VBA section), VBA book

Or using “Help” (by press F1) in MS office applications. Enter keyword you are looking for.