BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf ·...

19
| Chandoo.org - 2011 Introduction to Programming BECOME AWESOME IN VBA TOO

Transcript of BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf ·...

Page 1: BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf · BECOME AWESOME IN VBA TOO | Chandoo.org - 2011 What is in this ? • Computer Is

| Chandoo.org - 2011

Introduction to Programming

B E C O M E AW E S O M E I N V B A T O O

Page 2: BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf · BECOME AWESOME IN VBA TOO | Chandoo.org - 2011 What is in this ? • Computer Is

| Chandoo.org - 2011

What is in this ?

• Computer Is our Secretary!

• Programming Concepts

• Programming Lingo

• Tips for Getting your Fingers Dirty

Page 3: BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf · BECOME AWESOME IN VBA TOO | Chandoo.org - 2011 What is in this ? • Computer Is

| Chandoo.org - 2011

What is Programming?

A computer program is

a sequence of instructions

written to perform a specified task

for a computer.

Source: http://en.wikipedia.org/wiki/Computer_program

Page 4: BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf · BECOME AWESOME IN VBA TOO | Chandoo.org - 2011 What is in this ? • Computer Is

| Chandoo.org - 2011

Computer IS our secretary

Page 5: BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf · BECOME AWESOME IN VBA TOO | Chandoo.org - 2011 What is in this ? • Computer Is

| Chandoo.org - 2011

And there is no gender bias And there is no gender bias…

Source: http://backseatcuddler.com/wp-content/uploads/2009/05/george_clooney_01.jpg

Page 6: BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf · BECOME AWESOME IN VBA TOO | Chandoo.org - 2011 What is in this ? • Computer Is

| Chandoo.org - 2011

Hello World Program

Sub helloWorld()

Debug.Print "Hello World"

End Sub

Page 7: BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf · BECOME AWESOME IN VBA TOO | Chandoo.org - 2011 What is in this ? • Computer Is

| Chandoo.org - 2011

More Hello Worlds

Sub helloWorld2()

MsgBox "I am a pretty little box!", vbOKOnly, "Hello World"

End Sub

Sub helloWorld3()

ActiveCell.Value = "Hello World!"

End Sub

Page 8: BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf · BECOME AWESOME IN VBA TOO | Chandoo.org - 2011 What is in this ? • Computer Is

| Chandoo.org - 2011

Programming Concepts

• Variables

• Operators

• Conditions

• Loops

• Exception Handling

• Modularization

• Commenting, Documentation, Help

• Forms, Buttons & Graphical Elements

Page 9: BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf · BECOME AWESOME IN VBA TOO | Chandoo.org - 2011 What is in this ? • Computer Is

| Chandoo.org - 2011

Variables

Little boxes where computer keeps the data

while doing the work

Page 10: BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf · BECOME AWESOME IN VBA TOO | Chandoo.org - 2011 What is in this ? • Computer Is

| Chandoo.org - 2011

Operators

+ - / * = < > ! . @ % ^ | ( ) { } [ ] ; :

Page 11: BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf · BECOME AWESOME IN VBA TOO | Chandoo.org - 2011 What is in this ? • Computer Is

| Chandoo.org - 2011

Conditions

IF then ELSE

SELECT

AND OR NOT

Page 12: BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf · BECOME AWESOME IN VBA TOO | Chandoo.org - 2011 What is in this ? • Computer Is

| Chandoo.org - 2011

LOOPS

FOR

WHILE

GOTO

Page 13: BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf · BECOME AWESOME IN VBA TOO | Chandoo.org - 2011 What is in this ? • Computer Is

| Chandoo.org - 2011

Exception Handling

On Error Play “Oops!... I did it again”

Something else..

Something else..

Source: Deja Britney

Page 14: BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf · BECOME AWESOME IN VBA TOO | Chandoo.org - 2011 What is in this ? • Computer Is

| Chandoo.org - 2011

Modularization

A car is not really a car,

It is thousands of parts carefully

put together

So is any computer program

It is made up of other smaller

computer programs

Page 15: BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf · BECOME AWESOME IN VBA TOO | Chandoo.org - 2011 What is in this ? • Computer Is

| Chandoo.org - 2011

Commenting, Documentation etc.

• Pieces of code that we write to tell ourselves

what is going on

• Computers ignore comments

Page 16: BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf · BECOME AWESOME IN VBA TOO | Chandoo.org - 2011 What is in this ? • Computer Is

| Chandoo.org - 2011

Graphical Elements

Buttons

Radio Buttons

Option Buttons

Combo Boxes

Tabs

Scrollbars

Images

So much more…

Page 17: BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf · BECOME AWESOME IN VBA TOO | Chandoo.org - 2011 What is in this ? • Computer Is

| Chandoo.org - 2011

Programming Concepts - recap

• Variables

• Operators

• Conditions

• Loops

• Exception Handling

• Modularization

• Commenting, Documentation, Help

• Forms, Buttons & Graphical Elements

Page 18: BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf · BECOME AWESOME IN VBA TOO | Chandoo.org - 2011 What is in this ? • Computer Is

| Chandoo.org - 2011

Join our VBA Class for more…,

http://chandoo.org/wp/vba-classes/

Page 19: BECOME AWESOME IN VBA TOO - Chandoo.orgimg.chandoo.org/vba/introduction to programming-part1.pdf · BECOME AWESOME IN VBA TOO | Chandoo.org - 2011 What is in this ? • Computer Is

| Chandoo.org - 2011

Thank you

http://chandoo.org/wp/vba-classes/

http://vbaclasses.com/learn/